Update tests for tuple HySequences
This commit is contained in:
parent
cc8948d9b9
commit
e6aac2308a
@ -21,10 +21,10 @@
|
|||||||
walk-form)))
|
walk-form)))
|
||||||
|
|
||||||
(defn test-walk []
|
(defn test-walk []
|
||||||
(setv acc '())
|
(setv acc [])
|
||||||
(assert (= (walk (partial collector acc) identity walk-form)
|
(assert (= (list (walk (partial collector acc) identity walk-form))
|
||||||
[None None]))
|
[None None]))
|
||||||
(assert (= acc walk-form))
|
(assert (= acc (list walk-form)))
|
||||||
(setv acc [])
|
(setv acc [])
|
||||||
(assert (= (walk identity (partial collector acc) walk-form)
|
(assert (= (walk identity (partial collector acc) walk-form)
|
||||||
None))
|
None))
|
||||||
@ -129,7 +129,7 @@
|
|||||||
'(foo `(bar a ~a ~"x"))))
|
'(foo `(bar a ~a ~"x"))))
|
||||||
(assert (= `(foo ~@[a])
|
(assert (= `(foo ~@[a])
|
||||||
'(foo "x")))
|
'(foo "x")))
|
||||||
(assert (= `(foo `(bar [a] ~@[a] ~@~[a 'a `a] ~~@[a]))
|
(assert (= `(foo `(bar [a] ~@[a] ~@~(HyList [a 'a `a]) ~~@[a]))
|
||||||
'(foo `(bar [a] ~@[a] ~@["x" a a] ~"x"))))))
|
'(foo `(bar [a] ~@[a] ~@["x" a a] ~"x"))))))
|
||||||
|
|
||||||
(defn test-let-except []
|
(defn test-let-except []
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
"NATIVE: test for quoting functionality"
|
"NATIVE: test for quoting functionality"
|
||||||
(setv q (quote (a b c)))
|
(setv q (quote (a b c)))
|
||||||
(assert (= (len q) 3))
|
(assert (= (len q) 3))
|
||||||
(assert (= q [(quote a) (quote b) (quote c)])))
|
(assert (= q (HyExpression [(quote a) (quote b) (quote c)]))))
|
||||||
|
|
||||||
|
|
||||||
(defn test-basic-quoting []
|
(defn test-basic-quoting []
|
||||||
|
@ -56,8 +56,8 @@ def test_list_add():
|
|||||||
a = HyList([1, 2, 3])
|
a = HyList([1, 2, 3])
|
||||||
b = HyList([3, 4, 5])
|
b = HyList([3, 4, 5])
|
||||||
c = a + b
|
c = a + b
|
||||||
assert c == [1, 2, 3, 3, 4, 5]
|
assert c == HyList([1, 2, 3, 3, 4, 5])
|
||||||
assert c.__class__ == HyList
|
assert type(c) is HyList
|
||||||
|
|
||||||
|
|
||||||
def test_list_slice():
|
def test_list_slice():
|
||||||
@ -91,7 +91,7 @@ hyset = HySet([3, 1, 2, 2])
|
|||||||
|
|
||||||
|
|
||||||
def test_set():
|
def test_set():
|
||||||
assert hyset == [3, 1, 2, 2]
|
assert list(hyset) == [3, 1, 2, 2]
|
||||||
|
|
||||||
|
|
||||||
def test_number_model_copy():
|
def test_number_model_copy():
|
||||||
|
Loading…
Reference in New Issue
Block a user