Add Nil constructor and tests

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
2024-09-30 12:48:45 -07:00
parent 3d0da0ec85
commit 724a6b6f99
6 changed files with 46 additions and 1 deletions

View File

@@ -70,3 +70,4 @@ println(Bool("true"))
println(Bool(1))
println(Bool(1.0))
println(Bool(true))
println(Bool(nil))

View File

@@ -53,3 +53,4 @@ true
true
true
true
false

16
tests/nil.npp Normal file
View 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
View File

@@ -0,0 +1,9 @@
__not__
true
false
__eq__
true
__ne__
false
constructor
nil