From: Jean Privat Date: Mon, 10 Mar 2014 13:41:48 +0000 (-0400) Subject: tests: add string-related tests X-Git-Tag: v0.6.5~44^2~1 X-Git-Url: http://nitlanguage.org tests: add string-related tests Signed-off-by: Jean Privat --- diff --git a/tests/sav/test_string_triple4.res b/tests/sav/test_string_triple4.res new file mode 100644 index 0000000..21c27be --- /dev/null +++ b/tests/sav/test_string_triple4.res @@ -0,0 +1,7 @@ + + +" +"" +""" +"""" +""""" diff --git a/tests/sav/test_string_triple4_alt1.res b/tests/sav/test_string_triple4_alt1.res new file mode 100644 index 0000000..67cf6fc --- /dev/null +++ b/tests/sav/test_string_triple4_alt1.res @@ -0,0 +1 @@ +alt/test_string_triple4_alt1.nit:15,7--14: Syntax error: unexpected malformed string "#alt1# . diff --git a/tests/sav/test_string_triple4_alt2.res b/tests/sav/test_string_triple4_alt2.res new file mode 100644 index 0000000..9669569 --- /dev/null +++ b/tests/sav/test_string_triple4_alt2.res @@ -0,0 +1,9 @@ + +#alt2# +#alt3# print " + +" +"" +""" +"""" +""""" diff --git a/tests/sav/test_string_triple4_alt3.res b/tests/sav/test_string_triple4_alt3.res new file mode 100644 index 0000000..be997e1 --- /dev/null +++ b/tests/sav/test_string_triple4_alt3.res @@ -0,0 +1,9 @@ + +"#alt3# +#alt4# print "" + +" +"" +""" +"""" +""""" diff --git a/tests/sav/test_string_triple4_alt4.res b/tests/sav/test_string_triple4_alt4.res new file mode 100644 index 0000000..c4541fc --- /dev/null +++ b/tests/sav/test_string_triple4_alt4.res @@ -0,0 +1,8 @@ + +""#alt4# +print """ +" +"" +""" +"""" +""""" diff --git a/tests/sav/test_string_triple5.res b/tests/sav/test_string_triple5.res new file mode 100644 index 0000000..93bf027 --- /dev/null +++ b/tests/sav/test_string_triple5.res @@ -0,0 +1,3 @@ + +"{}" +abcdef diff --git a/tests/test_string_triple4.nit b/tests/test_string_triple4.nit new file mode 100644 index 0000000..16a2791 --- /dev/null +++ b/tests/test_string_triple4.nit @@ -0,0 +1,25 @@ +# This file is part of NIT ( http://www.nitlanguage.org ). +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +#alt1# print " +print "" +#alt2# print """ +#alt3# print """" +#alt4# print """"" +print """""" +print """"""" +print """""""" +print """"""""" +print """""""""" +print """"""""""" diff --git a/tests/test_string_triple5.nit b/tests/test_string_triple5.nit new file mode 100644 index 0000000..cbdad49 --- /dev/null +++ b/tests/test_string_triple5.nit @@ -0,0 +1,20 @@ +# This file is part of NIT ( http://www.nitlanguage.org ). +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +print "{}{}" +print """"{{{{}}}}"""" + +print "ab{ + }cd{ # comment + }ef"