From d8a36ffbe663007fa8b4d97ecb7c5a7bb6a216ba Mon Sep 17 00:00:00 2001 From: Garrit Franke Date: Sat, 6 Feb 2021 22:27:14 +0100 Subject: [PATCH] tests: add ignored test_complex_nested_expressions --- examples/playground.sb | 2 +- src/parser/tests.rs | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/examples/playground.sb b/examples/playground.sb index 1c6dd5b..0000e32 100644 --- a/examples/playground.sb +++ b/examples/playground.sb @@ -1,5 +1,5 @@ fn main() { let x = (1 + (2 * 3)) - print(x) + println(x) } \ No newline at end of file diff --git a/src/parser/tests.rs b/src/parser/tests.rs index 2fd98b2..2caa7a6 100644 --- a/src/parser/tests.rs +++ b/src/parser/tests.rs @@ -745,3 +745,22 @@ fn test_break() { let tree = parse(tokens, Some(raw.to_string())); assert!(tree.is_ok()); } + +#[test] +#[ignore] +fn test_complex_nested_expressions() { + let raw = " + fn main() { + let year = 2020 + + if (year % 4 == 0) && (year % 100 != 0) || (year % 400 == 0) { + println('Leap year') + } else { + println('Not a leap year') + } + } + "; + let tokens = tokenize(raw); + let tree = parse(tokens, Some(raw.to_string())); + assert!(tree.is_ok()); +}