From 18a726b1d51ae1de1878fbdf1d57484cb0e39875 Mon Sep 17 00:00:00 2001 From: Johannes Bucher Date: Wed, 24 Oct 2018 14:00:45 +0200 Subject: [PATCH] add lexer test cases (group 6) --- lexer/comment_start_nested.mj | 3 +++ lexer/comment_start_nested.mj.out | 1 + lexer/file-noendofline.mj | 1 + lexer/file-noendofline.mj.out | 2 ++ lexer/invalid-integer.mj | 1 + lexer/invalid-integer.mj.out | 7 ++++++ lexer/nasty-comments.mj | 10 ++++++++ lexer/nasty-comments.mj.out | 13 +++++++++++ lexer/prinzip_des_laengsten_musters.mj | 1 + lexer/prinzip_des_laengsten_musters.mj.out | 27 ++++++++++++++++++++++ 10 files changed, 66 insertions(+) create mode 100644 lexer/comment_start_nested.mj create mode 100644 lexer/comment_start_nested.mj.out create mode 100644 lexer/file-noendofline.mj create mode 100644 lexer/file-noendofline.mj.out create mode 100644 lexer/invalid-integer.mj create mode 100644 lexer/invalid-integer.mj.out create mode 100644 lexer/nasty-comments.mj create mode 100644 lexer/nasty-comments.mj.out create mode 100644 lexer/prinzip_des_laengsten_musters.mj create mode 100644 lexer/prinzip_des_laengsten_musters.mj.out diff --git a/lexer/comment_start_nested.mj b/lexer/comment_start_nested.mj new file mode 100644 index 0000000..b55461c --- /dev/null +++ b/lexer/comment_start_nested.mj @@ -0,0 +1,3 @@ +/* starting an nested comment /* +should not produce an error +*/ diff --git a/lexer/comment_start_nested.mj.out b/lexer/comment_start_nested.mj.out new file mode 100644 index 0000000..1a2b1dc --- /dev/null +++ b/lexer/comment_start_nested.mj.out @@ -0,0 +1 @@ +EOF diff --git a/lexer/file-noendofline.mj b/lexer/file-noendofline.mj new file mode 100644 index 0000000..757f016 --- /dev/null +++ b/lexer/file-noendofline.mj @@ -0,0 +1 @@ +noendofline diff --git a/lexer/file-noendofline.mj.out b/lexer/file-noendofline.mj.out new file mode 100644 index 0000000..f7e66e6 --- /dev/null +++ b/lexer/file-noendofline.mj.out @@ -0,0 +1,2 @@ +identifier noendofline +EOF diff --git a/lexer/invalid-integer.mj b/lexer/invalid-integer.mj new file mode 100644 index 0000000..af21b80 --- /dev/null +++ b/lexer/invalid-integer.mj @@ -0,0 +1 @@ +int test = 42x; diff --git a/lexer/invalid-integer.mj.out b/lexer/invalid-integer.mj.out new file mode 100644 index 0000000..76017c5 --- /dev/null +++ b/lexer/invalid-integer.mj.out @@ -0,0 +1,7 @@ +int +identifier test += +integer literal 42 +identifier x +; +EOF diff --git a/lexer/nasty-comments.mj b/lexer/nasty-comments.mj new file mode 100644 index 0000000..24e511d --- /dev/null +++ b/lexer/nasty-comments.mj @@ -0,0 +1,10 @@ +/* Test comments */ + +public void func/*TEST*/() { + int local /*-------*/ = 10; + + /** A comment with another /* comment starting within + + public int x; + */ +} diff --git a/lexer/nasty-comments.mj.out b/lexer/nasty-comments.mj.out new file mode 100644 index 0000000..ca61ea5 --- /dev/null +++ b/lexer/nasty-comments.mj.out @@ -0,0 +1,13 @@ +public +void +identifier func +( +) +{ +int +identifier local += +integer literal 10 +; +} +EOF diff --git a/lexer/prinzip_des_laengsten_musters.mj b/lexer/prinzip_des_laengsten_musters.mj new file mode 100644 index 0000000..bbeeee3 --- /dev/null +++ b/lexer/prinzip_des_laengsten_musters.mj @@ -0,0 +1 @@ +==<<>>=====++=+=+--<==>==&&||&=|=>>>>>>>>=>>>=%=*=/=^= diff --git a/lexer/prinzip_des_laengsten_musters.mj.out b/lexer/prinzip_des_laengsten_musters.mj.out new file mode 100644 index 0000000..cef9366 --- /dev/null +++ b/lexer/prinzip_des_laengsten_musters.mj.out @@ -0,0 +1,27 @@ +== +<< +>>= +== +== +++ += ++= ++ +-- +<= += +>= += +&& +|| +&= +|= +>>> +>>> +>>= +>>>= +%= +*= +/= +^= +EOF -- GitLab