| 1 |
/* |
| 2 |
Copyright 2015 Google Inc. All rights reserved. |
| 3 |
|
| 4 |
Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 |
you may not use this file except in compliance with the License. |
| 6 |
You may obtain a copy of the License at |
| 7 |
|
| 8 |
http://www.apache.org/licenses/LICENSE-2.0 |
| 9 |
|
| 10 |
Unless required by applicable law or agreed to in writing, software |
| 11 |
distributed under the License is distributed on an "AS IS" BASIS, |
| 12 |
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 |
See the License for the specific language governing permissions and |
| 14 |
limitations under the License. |
| 15 |
*/ |
| 16 |
|
| 17 |
std.assertEqual(1 + 2 * 3, 7) && |
| 18 |
std.assertEqual(1 + 2 * 3, 7) && |
| 19 |
std.assertEqual(+1 + 2 * 3, 7) && |
| 20 |
std.assertEqual(-1 + 2 * 3, 5) && |
| 21 |
std.assertEqual(3 + 2 / 2, 4) && |
| 22 |
std.assertEqual(6 - 3 + 2, 5) && |
| 23 |
std.assertEqual(6 / 3 / 2, 1) && |
| 24 |
std.assertEqual(6 / 3 / 2, 1) && |
| 25 |
std.assertEqual(6 / 3 * 2, 4) && |
| 26 |
std.assertEqual(6 / 3 % 2, 0) && |
| 27 |
std.assertEqual(1 + 2 << 1, 6) && |
| 28 |
std.assertEqual(42 << 1 >> 1, 42) && |
| 29 |
std.assertEqual(42 > 40 + 2, false) && |
| 30 |
std.assertEqual(42 >= 40 + 2, true) && |
| 31 |
std.assertEqual(42 < 40 + 2, false) && |
| 32 |
std.assertEqual(42 <= 40 + 2, true) && |
| 33 |
std.assertEqual(1 + 1 == 2, true) && |
| 34 |
std.assertEqual(1 | 3 & 6, 3) && |
| 35 |
std.assertEqual(1 | 3 & 6 ^ 2, 1) && |
| 36 |
std.assertEqual(false && true || false, false) && |
| 37 |
std.assertEqual(!false && true || false, true) && |
| 38 |
std.assertEqual(true && false || false, false) && |
| 39 |
std.assertEqual(if true then 1 else 2 + 3, 1) && |
| 40 |
std.assertEqual(':' + if true then 'foo' else error 'bar' + 'baz', ':foo') && |
| 41 |
std.assertEqual(':' + if true then 'foo' else function() 'bar' + 'baz', ':foo') && |
| 42 |
std.assertEqual(20 * local x = 6; x + 4, 200) && |
| 43 |
|
| 44 |
true |