diff -r 43287eef2fff -r 072f1114ea5d tests/basic/string-lit-2.sp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/basic/string-lit-2.sp Mon Dec 24 16:09:13 2012 -0800 @@ -0,0 +1,26 @@ +native PrintNum(num); + +f(x) +{ + new char:str1[]; + new char:str2[4]; + + str1 = "hello"; + str2 = "bye"; + + // Make sure modifying the string doesn't modify the + // canonical literals. + if (x) { + str1[1] = 65; + str2[1] = 68; + } + + PrintNum(str1[1]); + PrintNum(str2[1]); +} + +public main() +{ + f(1); + f(0); +}