From 5c710e33c8897f036dd7a5b75b2cc658b9aa99ea Mon Sep 17 00:00:00 2001 From: Jake Date: Sat, 22 Jun 2024 17:01:33 -0700 Subject: [PATCH] Add two tests --- tests/identtest.c | 23 +++++++++++++++++++++++ tests/mathtest.c | 21 +++++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 tests/identtest.c create mode 100644 tests/mathtest.c diff --git a/tests/identtest.c b/tests/identtest.c new file mode 100644 index 0000000..2698745 --- /dev/null +++ b/tests/identtest.c @@ -0,0 +1,23 @@ +/* We should get the tokens in order: + int + main + ( + ) + { + int + a + = + 100 + ; + return + a + * + 5 + ; + [end of file] +*/ + +int main() { + int a = 100; + return a * 5; +} diff --git a/tests/mathtest.c b/tests/mathtest.c new file mode 100644 index 0000000..0127586 --- /dev/null +++ b/tests/mathtest.c @@ -0,0 +1,21 @@ +/* We should get the tokens in order: + int + main + ( + ) + { + return + ( + 100 + * + 4 + ) + + + 3 + ; + [end of file] +*/ + +int main() { + return (100 * 4) + 3; +}