diff --git a/test/test_suite/comments/complex_nesting.c3 b/test/test_suite/comments/complex_nesting.c3 new file mode 100644 index 000000000..db6f5267d --- /dev/null +++ b/test/test_suite/comments/complex_nesting.c3 @@ -0,0 +1,11 @@ +// this test stress-tests the compiler ability to handle complex comments + +/* first of all, I wanna say that <* linux *> is the best OS ever! + secondly, #!pizza, it's a masterpiece... nothing is better than pizza, // thanks to who cooked it for the first time.. + I want to rant windows but I'm afraid of it getting mad and not supporting C3.. /* I'll not cause problems, just for this time */ + I'm forced to use windows for ~4 more months just for my school.. /* this is TERRIBLE guys */ + #! this line would fail because it's "#!" isn't in the right place (the first two characters of a file).. but since we're already in a comment, it' fine! +*/ + +#! this line should raise an error! // #error: a global +// while this shouldn't! diff --git a/test/test_suite/comments/instring_comments.c3 b/test/test_suite/comments/instring_comments.c3 new file mode 100644 index 000000000..d048b9fc6 --- /dev/null +++ b/test/test_suite/comments/instring_comments.c3 @@ -0,0 +1,15 @@ +module instring_comments; + +import std; + +// this test proves the compiler can handle in string comments reliabely. + +fn void test_len() @test { + + String foo = "Hello, // world!"; + String bar = "Hello, /* world */!"; + + assert(foo.len == 16); + assert(bar.len == 19); + +}