aboutsummaryrefslogtreecommitdiff
path: root/spec/outputs/string.lua
diff options
context:
space:
mode:
authorLi Jin <dragon-fly@qq.com>2021-10-12 10:04:44 +0800
committerLi Jin <dragon-fly@qq.com>2021-10-12 10:04:44 +0800
commit60a979e224f26117f5be82bfca757a2483cef0fd (patch)
tree7c6af44f6dcada1f23979b820ba830251997b161 /spec/outputs/string.lua
parenta19b242cbaf53721b20a3163dd06f43e9ef2b487 (diff)
downloadyuescript-60a979e224f26117f5be82bfca757a2483cef0fd.tar.gz
yuescript-60a979e224f26117f5be82bfca757a2483cef0fd.tar.bz2
yuescript-60a979e224f26117f5be82bfca757a2483cef0fd.zip
fix test.
Diffstat (limited to 'spec/outputs/string.lua')
-rw-r--r--spec/outputs/string.lua42
1 files changed, 42 insertions, 0 deletions
diff --git a/spec/outputs/string.lua b/spec/outputs/string.lua
new file mode 100644
index 0000000..84b6700
--- /dev/null
+++ b/spec/outputs/string.lua
@@ -0,0 +1,42 @@
1local hi = "hello"
2local hello = "what the heckyes"
3print(hi)
4local umm = 'umm'
5local here, another = "yeah", 'world'
6local aye = "YU'M"
7you('"hmmm" I said')
8print(aye, you)
9another = [[ hello world ]]
10local hi_there = [[ hi there
11]]
12local well = [==[ "helo" ]==]
13local hola = [===[ eat noots]===]
14local mm = [[well trhere]]
15local txt = [[
16
17nil
18Fail to compile
19]]
20local oo = ""
21local x = "\\"
22x = "a\\b"
23x = "\\\n"
24x = "\""
25local a = "hello " .. tostring(hello) .. " hello"
26local b = tostring(hello) .. " hello"
27local c = "hello " .. tostring(5 + 1)
28local d = tostring(hello(world))
29local e = tostring(1) .. " " .. tostring(2) .. " " .. tostring(3)
30local f = [[hello #{world} world]]
31a = 'hello #{hello} hello'
32b = '#{hello} hello'
33c = 'hello #{hello}'
34local _ = "hello";
35("hello"):format(1);
36("hello"):format(1, 2, 3);
37("hello"):format(1, 2, 3)(1, 2, 3);
38("hello"):world();
39("hello"):format().hello(1, 2, 3);
40("hello"):format(1, 2, 3)
41something("hello"):world()
42return something(("hello"):world())