From 5a113551424bc98841349fa19dfc813deaca1973 Mon Sep 17 00:00:00 2001 From: Nilstrieb <48135649+Nilstrieb@users.noreply.github.com> Date: Sat, 1 Jan 2022 13:51:55 +0100 Subject: [PATCH] yandere dev moment --- tests/control_flow.rs | 27 +++++++++++++++++++ ...l_flow__if_else_long_comparison_chain.snap | 7 +++++ 2 files changed, 34 insertions(+) create mode 100644 tests/snapshots/control_flow__if_else_long_comparison_chain.snap 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"