parser: add simple parser and tests
This commit is contained in:
3
src/Phsyche.package/PhsycheTest.class/instance/setUp.st
Normal file
3
src/Phsyche.package/PhsycheTest.class/instance/setUp.st
Normal file
@@ -0,0 +1,3 @@
|
||||
tests
|
||||
setUp
|
||||
ph := Phsyche new
|
@@ -0,0 +1,3 @@
|
||||
tests
|
||||
testParseEmptyList
|
||||
self assert: (ph parse: '()') equals: #()
|
@@ -0,0 +1,3 @@
|
||||
tests
|
||||
testParseFloat
|
||||
self assert: (ph parse: '12.33') equals: 12.33
|
@@ -0,0 +1,8 @@
|
||||
tests
|
||||
testParseIsNull
|
||||
self
|
||||
assert: (ph parse: '(isNull (cons (quote a) #()))')
|
||||
equals: #(#isNull #(#cons #(#quote #a) #())).
|
||||
self
|
||||
assert: (ph parse: '(isNull (cons (quote a) ()))')
|
||||
equals: #(#isNull #(#cons #(#quote #a) #()))
|
@@ -0,0 +1,5 @@
|
||||
tests
|
||||
testParseLambda
|
||||
self
|
||||
assert: (ph parse: '(define squared (lambda (x) (* x x)))')
|
||||
equals: #(#define #squared #(#lambda #(#x) #(* x x)))
|
@@ -0,0 +1,3 @@
|
||||
tests
|
||||
testParseSymbol
|
||||
self assert: (ph parse: 'r') equals: #r
|
Reference in New Issue
Block a user