diff options
| author | Li Jin <dragon-fly@qq.com> | 2026-02-12 09:08:12 +0800 |
|---|---|---|
| committer | Li Jin <dragon-fly@qq.com> | 2026-02-12 09:08:12 +0800 |
| commit | 640dcd82b30629f54596820c09144dfff10cb2c0 (patch) | |
| tree | e6c1822f459b8afc64d06a86459cf676ea7c74c2 /spec/inputs/test/format_spec.yue | |
| parent | 4e7edb2bd615e0a86b593c56c3392fab2110b1a1 (diff) | |
| download | yuescript-640dcd82b30629f54596820c09144dfff10cb2c0.tar.gz yuescript-640dcd82b30629f54596820c09144dfff10cb2c0.tar.bz2 yuescript-640dcd82b30629f54596820c09144dfff10cb2c0.zip | |
Added more tests.
Diffstat (limited to 'spec/inputs/test/format_spec.yue')
| -rw-r--r-- | spec/inputs/test/format_spec.yue | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/spec/inputs/test/format_spec.yue b/spec/inputs/test/format_spec.yue index afe9331..8c6096a 100644 --- a/spec/inputs/test/format_spec.yue +++ b/spec/inputs/test/format_spec.yue | |||
| @@ -113,6 +113,7 @@ files = [ | |||
| 113 | "spec/inputs/test/loops_spec.yue" | 113 | "spec/inputs/test/loops_spec.yue" |
| 114 | "spec/inputs/test/if_assignment_spec.yue" | 114 | "spec/inputs/test/if_assignment_spec.yue" |
| 115 | "spec/inputs/test/tables_advanced_spec.yue" | 115 | "spec/inputs/test/tables_advanced_spec.yue" |
| 116 | "spec/inputs/test/break_multiple_values_spec.yue" | ||
| 116 | "spec/inputs/unicode/macro_export.yue" | 117 | "spec/inputs/unicode/macro_export.yue" |
| 117 | "spec/inputs/unicode/attrib.yue" | 118 | "spec/inputs/unicode/attrib.yue" |
| 118 | "spec/inputs/unicode/macro.yue" | 119 | "spec/inputs/unicode/macro.yue" |
| @@ -179,11 +180,13 @@ for file in *files | |||
| 179 | code = f\read "a*" | 180 | code = f\read "a*" |
| 180 | f\close! | 181 | f\close! |
| 181 | 182 | ||
| 182 | original_ast = yue.to_ast code | 183 | original_ast, err = yue.to_ast code |
| 184 | assert.is_nil err | ||
| 183 | assert.is_not_nil original_ast | 185 | assert.is_not_nil original_ast |
| 184 | rewriteLineCol original_ast | 186 | rewriteLineCol original_ast |
| 185 | formated = yue.format code, 0, true | 187 | formated = yue.format code, 0, true |
| 186 | ast = yue.to_ast formated | 188 | ast, err = yue.to_ast formated |
| 189 | assert.is_nil err | ||
| 187 | assert.is_not_nil ast | 190 | assert.is_not_nil ast |
| 188 | rewriteLineCol ast | 191 | rewriteLineCol ast |
| 189 | assert.same original_ast, ast | 192 | assert.same original_ast, ast |
