tests: add string-related tests
authorJean Privat <jean@pryen.org>
Mon, 10 Mar 2014 13:41:48 +0000 (09:41 -0400)
committerJean Privat <jean@pryen.org>
Mon, 10 Mar 2014 14:32:19 +0000 (10:32 -0400)
Signed-off-by: Jean Privat <jean@pryen.org>

tests/sav/test_string_triple4.res [new file with mode: 0644]
tests/sav/test_string_triple4_alt1.res [new file with mode: 0644]
tests/sav/test_string_triple4_alt2.res [new file with mode: 0644]
tests/sav/test_string_triple4_alt3.res [new file with mode: 0644]
tests/sav/test_string_triple4_alt4.res [new file with mode: 0644]
tests/sav/test_string_triple5.res [new file with mode: 0644]
tests/test_string_triple4.nit [new file with mode: 0644]
tests/test_string_triple5.nit [new file with mode: 0644]

diff --git a/tests/sav/test_string_triple4.res b/tests/sav/test_string_triple4.res
new file mode 100644 (file)
index 0000000..21c27be
--- /dev/null
@@ -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 (file)
index 0000000..67cf6fc
--- /dev/null
@@ -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 (file)
index 0000000..9669569
--- /dev/null
@@ -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 (file)
index 0000000..be997e1
--- /dev/null
@@ -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 (file)
index 0000000..c4541fc
--- /dev/null
@@ -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 (file)
index 0000000..93bf027
--- /dev/null
@@ -0,0 +1,3 @@
+
+"{}"
+abcdef
diff --git a/tests/test_string_triple4.nit b/tests/test_string_triple4.nit
new file mode 100644 (file)
index 0000000..16a2791
--- /dev/null
@@ -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 (file)
index 0000000..cbdad49
--- /dev/null
@@ -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"