diff options
| author | Li Jin <dragon-fly@qq.com> | 2026-01-28 18:43:14 +0800 |
|---|---|---|
| committer | Li Jin <dragon-fly@qq.com> | 2026-01-28 18:43:14 +0800 |
| commit | dd64edd58fe25ec74ae5958128cf3f74b0692f3b (patch) | |
| tree | 0f2de1df55897e2713977c5a53936757e14b477a /spec/inputs/test/operator_advanced_spec.yue | |
| parent | 7c2a92b82e9808d3c5ea29b47d1c59d663fe984a (diff) | |
| download | yuescript-dd64edd58fe25ec74ae5958128cf3f74b0692f3b.tar.gz yuescript-dd64edd58fe25ec74ae5958128cf3f74b0692f3b.tar.bz2 yuescript-dd64edd58fe25ec74ae5958128cf3f74b0692f3b.zip | |
Fixed compiler issues and added 800+ test cases.
Diffstat (limited to 'spec/inputs/test/operator_advanced_spec.yue')
| -rw-r--r-- | spec/inputs/test/operator_advanced_spec.yue | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/spec/inputs/test/operator_advanced_spec.yue b/spec/inputs/test/operator_advanced_spec.yue index 8127fd4..8f88d17 100644 --- a/spec/inputs/test/operator_advanced_spec.yue +++ b/spec/inputs/test/operator_advanced_spec.yue | |||
| @@ -75,7 +75,7 @@ describe "advanced operators", -> | |||
| 75 | 75 | ||
| 76 | it "should handle compound bitwise xor", -> | 76 | it "should handle compound bitwise xor", -> |
| 77 | x = 12 -- 1100 in binary | 77 | x = 12 -- 1100 in binary |
| 78 | x ~= 10 -- 1010 in binary | 78 | x = x~10 -- 1010 in binary |
| 79 | assert.same x, 6 -- 0110 in binary | 79 | assert.same x, 6 -- 0110 in binary |
| 80 | 80 | ||
| 81 | it "should work with compound left shift", -> | 81 | it "should work with compound left shift", -> |
| @@ -121,10 +121,10 @@ describe "advanced operators", -> | |||
| 121 | it "should work with :: for method chaining", -> | 121 | it "should work with :: for method chaining", -> |
| 122 | obj = | 122 | obj = |
| 123 | value: 10 | 123 | value: 10 |
| 124 | add: (n) => @value += n | 124 | add: (n): @ => @value += n |
| 125 | get: => @value | 125 | get: => @value |
| 126 | 126 | ||
| 127 | result = obj::add 5::get! | 127 | result = obj::add(5)::get! |
| 128 | assert.same result, 15 | 128 | assert.same result, 15 |
| 129 | 129 | ||
| 130 | it "should handle complex expressions with precedence", -> | 130 | it "should handle complex expressions with precedence", -> |
