Add integration tests
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
40
tests/str.npp
Normal file
40
tests/str.npp
Normal file
@@ -0,0 +1,40 @@
|
||||
# Str type operator and function tests
|
||||
|
||||
a = "asdf"
|
||||
b = 'This is a longer sentence'
|
||||
c = 'the quick brown fox jumped over the lazy dog\'s escaped characters'
|
||||
|
||||
# to_str
|
||||
println("to_str")
|
||||
println(a)
|
||||
println(a.to_str())
|
||||
println(b)
|
||||
println(b.to_str())
|
||||
println(c)
|
||||
println(c.to_str())
|
||||
|
||||
# to_repr
|
||||
println("to_repr")
|
||||
println("to_repr".to_repr())
|
||||
println(a.to_repr())
|
||||
println(b.to_repr())
|
||||
println(c.to_repr())
|
||||
println('I would\ninclude a\nmultiline string if\nit wasn\'t such a\npain to\ntest in the\n.expect file'.to_repr())
|
||||
|
||||
# len
|
||||
println("len")
|
||||
println(a.len())
|
||||
println(b.len())
|
||||
println(c.len())
|
||||
|
||||
# __add__
|
||||
println("__add__")
|
||||
println(a + a)
|
||||
println(a + a + a)
|
||||
println(a + b)
|
||||
println(b + a)
|
||||
# __mul__
|
||||
println("__mul__")
|
||||
println(a * 4)
|
||||
println(b * 5)
|
||||
println((a * 6).to_repr())
|
||||
Reference in New Issue
Block a user