mirror of
https://github.com/wren-lang/wren.git
synced 2026-01-11 22:28:45 +01:00
Merge branch 'master' into smarter-imports
# Conflicts: # src/module/io.c # src/vm/wren_vm.c
This commit is contained in:
16
test/core/string/trim.wren
Normal file
16
test/core/string/trim.wren
Normal file
@ -0,0 +1,16 @@
|
||||
System.print("".trim() == "") // expect: true
|
||||
System.print("foo".trim() == "foo") // expect: true
|
||||
System.print(" \t\r\nfoo b\tar \t\r\n".trim() == "foo b\tar") // expect: true
|
||||
System.print(" \t\r\n \t\r\n".trim() == "") // expect: true
|
||||
System.print(" \n\n\tsøméஃthîng \n\n\t".trim() == "søméஃthîng") // expect: true
|
||||
|
||||
System.print("".trim("abc") == "") // expect: true
|
||||
System.print("foo".trim("abc") == "foo") // expect: true
|
||||
System.print("foo".trim("") == "foo") // expect: true
|
||||
System.print("cbacbfoobarab".trim("abc") == "foobar") // expect: true
|
||||
System.print("abcbacba".trim("abc") == "") // expect: true
|
||||
System.print("søméஃthîngsøméஃ".trim("ஃmésø") == "thîng") // expect: true
|
||||
|
||||
// 8-bit clean.
|
||||
System.print(" \t\ra\0b \t\r".trim() == "a\0b") // expect: true
|
||||
System.print("\0a\0b\0c\0".trim("c\0a") == "b") // expect: true
|
||||
1
test/core/string/trim_chars_not_string.wren
Normal file
1
test/core/string/trim_chars_not_string.wren
Normal file
@ -0,0 +1 @@
|
||||
"abracadabra".trim(123) // expect runtime error: Characters must be a string.
|
||||
16
test/core/string/trim_end.wren
Normal file
16
test/core/string/trim_end.wren
Normal file
@ -0,0 +1,16 @@
|
||||
System.print("".trimEnd() == "") // expect: true
|
||||
System.print("foo".trimEnd() == "foo") // expect: true
|
||||
System.print(" \t\r\nfoo b\tar \t\r\n".trimEnd() == " \t\r\nfoo b\tar") // expect: true
|
||||
System.print(" \t\r\n \t\r\n".trimEnd() == "") // expect: true
|
||||
System.print("søméஃthîng \n\n\t".trimEnd() == "søméஃthîng") // expect: true
|
||||
|
||||
System.print("".trimEnd("abc") == "") // expect: true
|
||||
System.print("foo".trimEnd("abc") == "foo") // expect: true
|
||||
System.print("foo".trimEnd("") == "foo") // expect: true
|
||||
System.print("cbacbfoobarab".trimEnd("abc") == "cbacbfoobar") // expect: true
|
||||
System.print("abcbacba".trimEnd("abc") == "") // expect: true
|
||||
System.print("søméஃthîngsøméஃ".trimEnd("ஃmésø") == "søméஃthîng") // expect: true
|
||||
|
||||
// 8-bit clean.
|
||||
System.print(" \t\ra\0b \t\r".trimEnd() == " \t\ra\0b") // expect: true
|
||||
System.print("\0a\0b\0c\0".trimEnd("c\0") == "\0a\0b") // expect: true
|
||||
1
test/core/string/trim_end_chars_not_string.wren
Normal file
1
test/core/string/trim_end_chars_not_string.wren
Normal file
@ -0,0 +1 @@
|
||||
"abracadabra".trimEnd(123) // expect runtime error: Characters must be a string.
|
||||
16
test/core/string/trim_start.wren
Normal file
16
test/core/string/trim_start.wren
Normal file
@ -0,0 +1,16 @@
|
||||
System.print("".trimStart() == "") // expect: true
|
||||
System.print("foo".trimStart() == "foo") // expect: true
|
||||
System.print(" \t\r\nfoo b\tar \t\r\n".trimStart() == "foo b\tar \t\r\n") // expect: true
|
||||
System.print(" \t\r\n \t\r\n".trimStart() == "") // expect: true
|
||||
System.print(" \n\n\tsøméஃthîng".trimStart() == "søméஃthîng") // expect: true
|
||||
|
||||
System.print("".trimStart("abc") == "") // expect: true
|
||||
System.print("foo".trimStart("abc") == "foo") // expect: true
|
||||
System.print("foo".trimStart("") == "foo") // expect: true
|
||||
System.print("cbacbfoobarab".trimStart("abc") == "foobarab") // expect: true
|
||||
System.print("abcbacba".trimStart("abc") == "") // expect: true
|
||||
System.print("søméஃthîng".trimStart("ஃmésø") == "thîng") // expect: true
|
||||
|
||||
// 8-bit clean.
|
||||
System.print(" \t\ra\0b".trimStart() == "a\0b") // expect: true
|
||||
System.print("\0a\0b\0c\0".trimStart("a\0") == "b\0c\0") // expect: true
|
||||
1
test/core/string/trim_start_chars_not_string.wren
Normal file
1
test/core/string/trim_start_chars_not_string.wren
Normal file
@ -0,0 +1 @@
|
||||
"abracadabra".trimStart(123) // expect runtime error: Characters must be a string.
|
||||
2
test/language/bom.wren
Normal file
2
test/language/bom.wren
Normal file
@ -0,0 +1,2 @@
|
||||
// This file should have a UTF-8 byte order mark
|
||||
System.print("ok") // expect: ok
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
var a0 = "value"
|
||||
var a1 = a0
|
||||
// Slot zero is always taken to hold the closure or receiver.
|
||||
var a1 = "value"
|
||||
var a2 = a1
|
||||
var a3 = a2
|
||||
var a4 = a3
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
// Can have more than 256 local variables in a local scope, as long as they
|
||||
// Can have more than 255 local variables in a local scope, as long as they
|
||||
// aren't all in scope at the same time.
|
||||
|
||||
{
|
||||
{
|
||||
var a0 = "value a"
|
||||
var a1 = a0
|
||||
// Slot zero is always taken to hold the closure or receiver.
|
||||
var a1 = "value a"
|
||||
var a2 = a1
|
||||
var a3 = a2
|
||||
var a4 = a3
|
||||
@ -263,8 +263,8 @@
|
||||
}
|
||||
|
||||
{
|
||||
var b0 = "value b"
|
||||
var b1 = b0
|
||||
// Slot zero is always taken to hold the closure or receiver.
|
||||
var b1 = "value b"
|
||||
var b2 = b1
|
||||
var b3 = b2
|
||||
var b4 = b3
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
var a0 = "value"
|
||||
var a1 = a0
|
||||
// Slot zero is always taken to hold the closure or receiver.
|
||||
var a1 = "value"
|
||||
var a2 = a1
|
||||
var a3 = a2
|
||||
var a4 = a3
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
var a0 = "value"
|
||||
var a1 = a0
|
||||
// Slot zero is always taken to hold the closure or receiver.
|
||||
var a1 = "value"
|
||||
var a2 = a1
|
||||
var a3 = a2
|
||||
var a4 = a3
|
||||
|
||||
3
test/regression/494.wren
Normal file
3
test/regression/494.wren
Normal file
@ -0,0 +1,3 @@
|
||||
0[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
// expect error line 1
|
||||
// expect error line 4
|
||||
Reference in New Issue
Block a user