Update tests for tuple HySequences

This commit is contained in:
Kodi Arfer 2019-08-02 17:17:24 -04:00
parent cc8948d9b9
commit e6aac2308a
3 changed files with 8 additions and 8 deletions

View File

@ -21,10 +21,10 @@
walk-form)))
(defn test-walk []
(setv acc '())
(assert (= (walk (partial collector acc) identity walk-form)
(setv acc [])
(assert (= (list (walk (partial collector acc) identity walk-form))
[None None]))
(assert (= acc walk-form))
(assert (= acc (list walk-form)))
(setv acc [])
(assert (= (walk identity (partial collector acc) walk-form)
None))
@ -129,7 +129,7 @@
'(foo `(bar a ~a ~"x"))))
(assert (= `(foo ~@[a])
'(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"))))))
(defn test-let-except []

View File

@ -9,7 +9,7 @@
"NATIVE: test for quoting functionality"
(setv q (quote (a b c)))
(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 []

View File

@ -56,8 +56,8 @@ def test_list_add():
a = HyList([1, 2, 3])
b = HyList([3, 4, 5])
c = a + b
assert c == [1, 2, 3, 3, 4, 5]
assert c.__class__ == HyList
assert c == HyList([1, 2, 3, 3, 4, 5])
assert type(c) is HyList
def test_list_slice():
@ -91,7 +91,7 @@ hyset = HySet([3, 1, 2, 2])
def test_set():
assert hyset == [3, 1, 2, 2]
assert list(hyset) == [3, 1, 2, 2]
def test_number_model_copy():