diff --git a/source/compiler/tests/multiline_string_sizes.meta b/source/compiler/tests/multiline_string_sizes.meta new file mode 100644 index 0000000..bfdf252 --- /dev/null +++ b/source/compiler/tests/multiline_string_sizes.meta @@ -0,0 +1,5 @@ +{ + 'test_type': 'output_check', + 'errors': """ + """ +} diff --git a/source/compiler/tests/multiline_string_sizes.pwn b/source/compiler/tests/multiline_string_sizes.pwn new file mode 100644 index 0000000..6010f3d --- /dev/null +++ b/source/compiler/tests/multiline_string_sizes.pwn @@ -0,0 +1,23 @@ +// This file should pass with \r\n and \n. + +new str1[] = "hello"; +#assert sizeof(str1) == 6 + +new str2[] = "hello\ +"; +#assert sizeof(str2) == 6 + +new str3[] = "hello\ + "; +#assert sizeof(str3) == 6 + +new str4[] = "hello\ + world"; +#assert sizeof(str4) == 11 + +new str5[] = "hello + world"; +#assert sizeof(str5) == 23 + +#pragma unused str1, str2, str3, str4, str5 +