Skip to content

Commit

Permalink
test: add orelse AST printer test cases
Browse files Browse the repository at this point in the history
Signed-off-by: peefy <[email protected]>
  • Loading branch information
Peefy committed Feb 18, 2024
1 parent a735a37 commit b4d5e8f
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 1 deletion.
31 changes: 31 additions & 0 deletions kclvm/ast_pretty/src/test_data/orelse.input
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
if True:
a = 1
else:
if True:
b = 2

if True:
c = 3

d = [
if True:
1
else:
if True:
2

if True:
3

]
e = {
if True:
a = 1
else:
if True:
b = 2

if True:
c = 3

}
31 changes: 31 additions & 0 deletions kclvm/ast_pretty/src/test_data/orelse.output
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
if True:
a = 1
else:
if True:
b = 2

if True:
c = 3

d = [
if True:
1
else:
if True:
2

if True:
3

]
e = {
if True:
a = 1
else:
if True:
b = 2

if True:
c = 3

}
3 changes: 2 additions & 1 deletion kclvm/ast_pretty/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use pretty_assertions::assert_eq;

const FILE_INPUT_SUFFIX: &str = ".input";
const FILE_OUTPUT_SUFFIX: &str = ".output";
const TEST_CASES: &[&str; 16] = &[
const TEST_CASES: &[&str] = &[
"arguments",
"empty",
"if_stmt",
Expand All @@ -18,6 +18,7 @@ const TEST_CASES: &[&str; 16] = &[
"index_sign",
"joined_str",
"lambda",
"orelse",
"quant",
"rule",
"str",
Expand Down

0 comments on commit b4d5e8f

Please sign in to comment.