Index: lib/src/prism/tests/languages/elixir/string_feature.test |
diff --git a/lib/src/prism/tests/languages/elixir/string_feature.test b/lib/src/prism/tests/languages/elixir/string_feature.test |
new file mode 100644 |
index 0000000000000000000000000000000000000000..ca54f4be820506fe1e3a0a3b4ceebe0ad638592c |
--- /dev/null |
+++ b/lib/src/prism/tests/languages/elixir/string_feature.test |
@@ -0,0 +1,115 @@ |
+~s/foobar/ |
+~s/foo#{42}bar/ |
+~S|foobar| |
+~c"foobar" |
+~c"foo#{42}bar" |
+~C'foobar' |
+~w(foobar)c |
+~w(foo#{42}bar)s |
+~W[foobar]a |
+~s{foobar} |
+~s{foo#{42}bar} |
+~S<foobar> |
+ |
+""" |
+Foo bar |
+""" |
+ |
+''' |
+Foo bar |
+''' |
+ |
+~S""" |
+Foo bar |
+""" |
+ |
+~c""" |
+Foo bar |
+""" |
+ |
+~w""" |
+Foo bar |
+""" |
+ |
+"" |
+"foo" |
+"fo\"o\ |
+#{42}bar" |
+'' |
+'foo' |
+'fo\'o\ |
+bar' |
+ |
+---------------------------------------------------- |
+ |
+[ |
+ ["string", ["~s/foobar/"]], |
+ ["string", [ |
+ "~s/foo", |
+ ["interpolation", [ |
+ ["delimiter", "#{"], |
+ ["number", "42"], |
+ ["delimiter", "}"] |
+ ]], |
+ "bar/" |
+ ]], |
+ ["string", ["~S|foobar|"]], |
+ ["string", ["~c\"foobar\""]], |
+ ["string", [ |
+ "~c\"foo", |
+ ["interpolation", [ |
+ ["delimiter", "#{"], |
+ ["number", "42"], |
+ ["delimiter", "}"] |
+ ]], |
+ "bar\"" |
+ ]], |
+ ["string", ["~C'foobar'"]], |
+ ["string", ["~w(foobar)c"]], |
+ ["string", [ |
+ "~w(foo", |
+ ["interpolation", [ |
+ ["delimiter", "#{"], |
+ ["number", "42"], |
+ ["delimiter", "}"] |
+ ]], |
+ "bar)s" |
+ ]], |
+ ["string", ["~W[foobar]a"]], |
+ ["string", ["~s{foobar}"]], |
+ ["string", [ |
+ "~s{foo", |
+ ["interpolation", [ |
+ ["delimiter", "#{"], |
+ ["number", "42"], |
+ ["delimiter", "}"] |
+ ]], |
+ "bar}" |
+ ]], |
+ ["string", ["~S<foobar>"]], |
+ |
+ ["string", ["\"\"\"\r\nFoo bar\r\n\"\"\""]], |
+ ["string", ["'''\r\nFoo bar\r\n'''"]], |
+ ["string", ["~S\"\"\"\r\nFoo bar\r\n\"\"\""]], |
+ ["string", ["~c\"\"\"\r\nFoo bar\r\n\"\"\""]], |
+ ["string", ["~w\"\"\"\r\nFoo bar\r\n\"\"\""]], |
+ |
+ ["string", ["\"\""]], |
+ ["string", ["\"foo\""]], |
+ ["string", [ |
+ "\"fo\\\"o\\\r\n", |
+ ["interpolation", [ |
+ ["delimiter", "#{"], |
+ ["number", "42"], |
+ ["delimiter", "}"] |
+ ]], |
+ "bar\"" |
+ ]], |
+ ["string", ["''"]], |
+ ["string", ["'foo'"]], |
+ ["string", ["'fo\\'o\\\r\nbar'"]] |
+] |
+ |
+---------------------------------------------------- |
+ |
+Checks for strings. |