mirror of
https://github.com/wren-lang/wren.git
synced 2026-01-11 14:18:42 +01:00
- Test that a foreign method can return strings. - Test that a foreign method can return a string with null bytes. - Test wrenCall(). - Allow passing NULL for "v" to wrenCall(). - Allow "a" for passing an explicit length byte array to wrenCall().
24 lines
591 B
Plaintext
24 lines
591 B
Plaintext
class Api {
|
|
foreign static implicitNull
|
|
|
|
foreign static returnInt
|
|
foreign static returnFloat
|
|
|
|
foreign static returnTrue
|
|
foreign static returnFalse
|
|
|
|
foreign static returnString
|
|
foreign static returnBytes
|
|
}
|
|
|
|
System.print(Api.implicitNull == null) // expect: true
|
|
|
|
System.print(Api.returnInt) // expect: 123456
|
|
System.print(Api.returnFloat) // expect: 123.456
|
|
|
|
System.print(Api.returnTrue) // expect: true
|
|
System.print(Api.returnFalse) // expect: false
|
|
|
|
System.print(Api.returnString) // expect: a string
|
|
System.print(Api.returnBytes.bytes.toList) // expect: [97, 0, 98, 0, 99]
|