aboutsummaryrefslogtreecommitdiff
path: root/test/nums.tm
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2025-03-25 15:40:59 -0400
committerBruce Hill <bruce@bruce-hill.com>2025-03-25 15:40:59 -0400
commit1f9147187d66e95a0ffedd4d5595ec98646b5fe1 (patch)
tree14281e5cbde8e15fae63953b72844fb1a11d6f73 /test/nums.tm
parentd88d8648dc7802fbeac2f28dc5f2ef8fdfe1a9e4 (diff)
Make docstring tests use an actual expression AST instead of text
matching
Diffstat (limited to 'test/nums.tm')
-rw-r--r--test/nums.tm24
1 files changed, 12 insertions, 12 deletions
diff --git a/test/nums.tm b/test/nums.tm
index e5fd27e2..1dc83cee 100644
--- a/test/nums.tm
+++ b/test/nums.tm
@@ -3,13 +3,13 @@ func main():
= 1.5
>> n + n
- = 3
+ = 3.
>> n * 2
- = 3
+ = 3.
>> n - n
- = 0
+ = 0.
>> Num.PI
= 3.141592653589793
@@ -18,12 +18,12 @@ func main():
= "3.1415926536"
>> Num.INF
- = inf
+ = Num.INF
>> Num.INF:isinf()
= yes
>> nan := none : Num
- = none : Num?
+ = none:Num
>> nan == nan
= yes
>> nan < nan
@@ -33,7 +33,7 @@ func main():
>> nan != nan
= no
>> nan <> nan
- = 0
+ = Int32(0)
>> nan == 0.0
= no
>> nan < 0.0
@@ -43,13 +43,13 @@ func main():
>> nan != 0.0
= yes
>> nan <> 0.0
- = -1
+ = Int32(-1)
>> nan + 1
- = none : Num?
+ = none:Num
>> 0./0.
- = none : Num?
+ = none:Num
>> Num.PI:cos()!:near(-1)
= yes
@@ -60,15 +60,15 @@ func main():
= no
>> Num32.sqrt(16)
- = 4 : Num32?
+ = Num32(4)?
>> 0.25:mix(10, 20)
= 12.5
>> 2.0:mix(10, 20)
- = 30
+ = 30.
>> Num(5)
- = 5 : Num
+ = 5.
>> 0.5:percent()
= "50%"