diff --git a/tests/control_flow.rs b/tests/control_flow.rs index 40dd069..f4101b7 100644 --- a/tests/control_flow.rs +++ b/tests/control_flow.rs @@ -51,3 +51,30 @@ if false { } "# ); + +run_test!( + if_else_long_comparison_chain, + r#" +let string = "hi ._./"; + +if string == "no" { + print "WRONG"; +} else if string == "no as well" { + print "WRONG"; +} else if string == "wrong" { + print "WRONG"; +} else if string == "not the correct one" { + print "WRONG"; +} else if string == "hi ._. (wrong)" { + print "WRONG"; +} else if string == "" { + print "WRONG"; +} else if string == "how wrong should it be?" { + print "WRONG"; +} else if string == "hi ._./" { + print "true!"; +} else { + print "WRONG"; +} +"# +); diff --git a/tests/snapshots/control_flow__if_else_long_comparison_chain.snap b/tests/snapshots/control_flow__if_else_long_comparison_chain.snap new file mode 100644 index 0000000..18c058a --- /dev/null +++ b/tests/snapshots/control_flow__if_else_long_comparison_chain.snap @@ -0,0 +1,7 @@ +--- +source: tests/control_flow.rs +assertion_line: 55 +expression: output + +--- +"true!\n"