added another test for the parser
This commit is contained in:
@@ -184,3 +184,15 @@ esac";
|
||||
|
||||
insta::assert_debug_snapshot!(nodes)
|
||||
}
|
||||
#[test]
|
||||
fn parse_cursed() {
|
||||
let input = "if if if if case foo in foo) if true; then true; fi;; esac; then case foo in foo) until true; do true; done;; esac; fi; then until if case foo in foo) true;; esac; then if true; then true; fi; fi; do until until true; do true; done; do case foo in foo) true;; esac; done; done; fi; then until until case foo in foo) true;; esac; do if true; then true; fi; done; do until true; do true; done; done; fi; then until case foo in foo) case foo in foo) true;; esac;; esac; do if if true; then true; fi; then until true; do true; done; fi; done; elif until until case foo in foo) true;; esac; do if true; then true; fi; done; do case foo in foo) until true; do true; done;; esac; done; then case foo in foo) if case foo in foo) true;; esac; then if true; then true; fi; fi;; esac; else case foo in foo) until until true; do true; done; do case foo in foo) true;; esac; done;; esac; fi";
|
||||
|
||||
let tk_stream: Vec<_> = LexStream::new(Rc::new(input.to_string()), LexFlags::empty())
|
||||
.map(|tk| tk.unwrap())
|
||||
.collect();
|
||||
let nodes: Vec<_> = ParseStream::new(tk_stream).collect();
|
||||
|
||||
// 15,000 line snapshot file btw
|
||||
insta::assert_debug_snapshot!(nodes)
|
||||
}
|
||||
|
||||
15563
src/tests/snapshots/fern__tests__parser__parse_cursed.snap
Normal file
15563
src/tests/snapshots/fern__tests__parser__parse_cursed.snap
Normal file
File diff suppressed because it is too large
Load Diff
4516
src/tests/snapshots/fern__tests__parser__parse_final_boss.snap
Normal file
4516
src/tests/snapshots/fern__tests__parser__parse_final_boss.snap
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user