Some special characters in ids; new demos
Adds support for several special characters in identifiers. Adds a demo for converting values to source code and another for checking equality. Updates the existing demo and tests to reflect new names for functions returning booleans.
This commit is contained in:
20
test/Spec.hs
20
test/Spec.hs
@ -308,7 +308,7 @@ libraryTests = testGroup "Library Tests"
|
||||
result env @?= Fork (Stem (Stem Leaf)) (Stem Leaf)
|
||||
, testCase "I combinator" $ do
|
||||
library <- evaluateFile "./lib/base.tri"
|
||||
let input = "i not"
|
||||
let input = "i not?"
|
||||
env = evalTricu library (parseTricu input)
|
||||
result env @?= Fork (Fork (Stem Leaf) (Fork Leaf Leaf)) (Fork Leaf (Fork Leaf Leaf))
|
||||
, testCase "Triage test Leaf" $ do
|
||||
@ -328,32 +328,32 @@ libraryTests = testGroup "Library Tests"
|
||||
env @?= "\"Fork\""
|
||||
, testCase "Boolean NOT: true" $ do
|
||||
library <- evaluateFile "./lib/base.tri"
|
||||
let input = "not true"
|
||||
let input = "not? true"
|
||||
env = result $ evalTricu library (parseTricu input)
|
||||
env @?= Leaf
|
||||
, testCase "Boolean NOT: false" $ do
|
||||
library <- evaluateFile "./lib/base.tri"
|
||||
let input = "not false"
|
||||
let input = "not? false"
|
||||
env = result $ evalTricu library (parseTricu input)
|
||||
env @?= Stem Leaf
|
||||
, testCase "Boolean AND TF" $ do
|
||||
library <- evaluateFile "./lib/base.tri"
|
||||
let input = "and (t t) (t)"
|
||||
let input = "and? (t t) (t)"
|
||||
env = evalTricu library (parseTricu input)
|
||||
result env @?= Leaf
|
||||
, testCase "Boolean AND FT" $ do
|
||||
library <- evaluateFile "./lib/base.tri"
|
||||
let input = "and (t) (t t)"
|
||||
let input = "and? (t) (t t)"
|
||||
env = evalTricu library (parseTricu input)
|
||||
result env @?= Leaf
|
||||
, testCase "Boolean AND FF" $ do
|
||||
library <- evaluateFile "./lib/base.tri"
|
||||
let input = "and (t) (t)"
|
||||
let input = "and? (t) (t)"
|
||||
env = evalTricu library (parseTricu input)
|
||||
result env @?= Leaf
|
||||
, testCase "Boolean AND TT" $ do
|
||||
library <- evaluateFile "./lib/base.tri"
|
||||
let input = "and (t t) (t t)"
|
||||
let input = "and? (t t) (t t)"
|
||||
env = evalTricu library (parseTricu input)
|
||||
result env @?= Stem Leaf
|
||||
, testCase "List head" $ do
|
||||
@ -373,12 +373,12 @@ libraryTests = testGroup "Library Tests"
|
||||
result env @?= Fork Leaf Leaf
|
||||
, testCase "Empty list check" $ do
|
||||
library <- evaluateFile "./lib/base.tri"
|
||||
let input = "emptyList []"
|
||||
let input = "emptyList? []"
|
||||
env = evalTricu library (parseTricu input)
|
||||
result env @?= Stem Leaf
|
||||
, testCase "Non-empty list check" $ do
|
||||
library <- evaluateFile "./lib/base.tri"
|
||||
let input = "not (emptyList [(1) (2) (3)])"
|
||||
let input = "not? (emptyList? [(1) (2) (3)])"
|
||||
env = evalTricu library (parseTricu input)
|
||||
result env @?= Stem Leaf
|
||||
, testCase "Concatenate strings" $ do
|
||||
@ -388,7 +388,7 @@ libraryTests = testGroup "Library Tests"
|
||||
env @?= "\"Hello, world!\""
|
||||
, testCase "Verifying Equality" $ do
|
||||
library <- evaluateFile "./lib/base.tri"
|
||||
let input = "equal (t t t) (t t t)"
|
||||
let input = "equal? (t t t) (t t t)"
|
||||
env = evalTricu library (parseTricu input)
|
||||
result env @?= Stem Leaf
|
||||
]
|
||||
|
Reference in New Issue
Block a user