Add Nil constructor and tests
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
@@ -70,3 +70,4 @@ println(Bool("true"))
|
||||
println(Bool(1))
|
||||
println(Bool(1.0))
|
||||
println(Bool(true))
|
||||
println(Bool(nil))
|
||||
|
||||
@@ -53,3 +53,4 @@ true
|
||||
true
|
||||
true
|
||||
true
|
||||
false
|
||||
|
||||
16
tests/nil.npp
Normal file
16
tests/nil.npp
Normal file
@@ -0,0 +1,16 @@
|
||||
# Nil type operator and function tests
|
||||
|
||||
a = nil
|
||||
|
||||
println("__not__")
|
||||
println(!nil)
|
||||
println(!!nil)
|
||||
|
||||
println("__eq__")
|
||||
println(nil == nil)
|
||||
|
||||
println("__ne__")
|
||||
println(nil != nil)
|
||||
|
||||
println("constructor")
|
||||
println(Nil())
|
||||
9
tests/nil.npp.expect
Normal file
9
tests/nil.npp.expect
Normal file
@@ -0,0 +1,9 @@
|
||||
__not__
|
||||
true
|
||||
false
|
||||
__eq__
|
||||
true
|
||||
__ne__
|
||||
false
|
||||
constructor
|
||||
nil
|
||||
Reference in New Issue
Block a user