mirror of
https://github.com/wren-lang/wren.git
synced 2026-01-11 14:18:42 +01:00
More tests for primitives.
This commit is contained in:
6
test/number_abs.wren
Normal file
6
test/number_abs.wren
Normal file
@ -0,0 +1,6 @@
|
||||
io.write(123.abs) // expect: 123
|
||||
io.write(-123.abs) // expect: 123
|
||||
io.write(0.abs) // expect: 0
|
||||
io.write(-0.abs) // expect: 0
|
||||
|
||||
// TODO(bob): Floating point numbers.
|
||||
8
test/string_contains.wren
Normal file
8
test/string_contains.wren
Normal file
@ -0,0 +1,8 @@
|
||||
io.write("".contains("")) // expect: 1
|
||||
io.write("anything".contains("")) // expect: 1
|
||||
io.write("something".contains("meth")) // expect: 1
|
||||
io.write("something".contains("some")) // expect: 1
|
||||
io.write("something".contains("ing")) // expect: 1
|
||||
io.write("something".contains("math")) // expect: 0
|
||||
|
||||
// TODO(bob): Passing non-string as argument.
|
||||
2
test/string_count.wren
Normal file
2
test/string_count.wren
Normal file
@ -0,0 +1,2 @@
|
||||
io.write("".count) // expect: 0
|
||||
io.write("a string".count) // expect: 8
|
||||
Reference in New Issue
Block a user