Skip to content

Commit a374774

Browse files
authored
Fix tests that had left over edits that broke them. (#208)
These tests had `loopy` at the front of the loopy body because we were testing the loop-body code used the tests. That is not needed for the actual test.
1 parent 264a382 commit a374774

File tree

1 file changed

+60
-60
lines changed

1 file changed

+60
-60
lines changed

tests/tests.el

+60-60
Original file line numberDiff line numberDiff line change
@@ -1442,14 +1442,14 @@ Using numbers directly will use less variables and more efficient code."
14421442
(loopy-deftest iter-single-var-with-bound
14431443
:doc "When single var is `with'-bound, `iter' must be indirect."
14441444
:result '(27 1 1 2 2 3)
1445-
:body (loopy (with (iter-maker (iter-lambda ()
1446-
(iter-yield 1)
1447-
(iter-yield 2)
1448-
(iter-yield 3)))
1449-
(i 27))
1450-
(collect i)
1451-
(iter i (funcall iter-maker))
1452-
(collect i))
1445+
:body ((with (iter-maker (iter-lambda ()
1446+
(iter-yield 1)
1447+
(iter-yield 2)
1448+
(iter-yield 3)))
1449+
(i 27))
1450+
(collect i)
1451+
(iter i (funcall iter-maker))
1452+
(collect i))
14531453
:loopy t
14541454
:iter-keyword (iter collect)
14551455
:iter-bare ((iter . iterating)
@@ -1564,9 +1564,9 @@ Using numbers directly will use less variables and more efficient code."
15641564
(loopy-deftest list-destructuring
15651565
:doc "Check that `list' implements destructuring, not destructuring itself."
15661566
:result '(5 6)
1567-
:body (loopy (list (a . b)
1568-
'((1 . 2) (3 . 4) (5 . 6)))
1569-
(finally-return a b))
1567+
:body ((list (a . b)
1568+
'((1 . 2) (3 . 4) (5 . 6)))
1569+
(finally-return a b))
15701570
:loopy t
15711571
:iter-keyword (list)
15721572
:iter-bare ((list . listing)))
@@ -1692,9 +1692,9 @@ Using numbers directly will use less variables and more efficient code."
16921692
(loopy-deftest map-vector
16931693
:result '((0 . a) (1 . b) (2 . c) (3 . d))
16941694
:repeat _map
1695-
:body (loopy (_map pair [a b c d])
1696-
(collect coll pair)
1697-
(finally-return coll))
1695+
:body ((_map pair [a b c d])
1696+
(collect coll pair)
1697+
(finally-return coll))
16981698
:loopy ((_map . (map map-pairs)))
16991699
:iter-keyword ((_map . (map map-pairs))
17001700
(collect . collect))
@@ -1803,10 +1803,10 @@ Using numbers directly will use less variables and more efficient code."
18031803
(loopy-deftest map-ref-:unique-nil
18041804
:doc "Fist `:a' becomes 15 because it gets found twice by `setf'."
18051805
:result '(:a 15 :a 2 :b 10)
1806-
:body (loopy (with (map (list :a 1 :a 2 :b 3)))
1807-
(map-ref i map :unique nil)
1808-
(do (cl-incf i 7))
1809-
(finally-return map))
1806+
:body ((with (map (list :a 1 :a 2 :b 3)))
1807+
(map-ref i map :unique nil)
1808+
(do (cl-incf i 7))
1809+
(finally-return map))
18101810
:loopy t
18111811
:iter-keyword (map-ref do collect)
18121812
:iter-bare ((map-ref . mapping-ref)
@@ -2265,12 +2265,12 @@ Using numbers directly will use less variables and more efficient code."
22652265
3))
22662266
(collect i))
22672267

2268-
(loopy (with (times 0))
2269-
(sequence i (vector 2 1 0) :above (progn
2270-
(cl-assert (= times 0))
2271-
(cl-incf times)
2272-
-1))
2273-
(collect i))]
2268+
((with (times 0))
2269+
(sequence i (vector 2 1 0) :above (progn
2270+
(cl-assert (= times 0))
2271+
(cl-incf times)
2272+
-1))
2273+
(collect i))]
22742274
:loopy t
22752275
:iter-keyword (sequence collect)
22762276
:iter-bare ((sequence . sequencing)
@@ -2625,9 +2625,9 @@ Using numbers directly will use less variables and more efficient code."
26252625
(loopy-deftest seq-index-init-no-with
26262626
:doc "`seq-index' can default to the starting index if not with-bound."
26272627
:result '(0 0 1 1 2 2 3 3)
2628-
:body (loopy (collect i)
2629-
(seq-index i [1 2 3 4])
2630-
(collect i))
2628+
:body ((collect i)
2629+
(seq-index i [1 2 3 4])
2630+
(collect i))
26312631
:loopy t
26322632
:iter-keyword (seq-index collect)
26332633
:iter-bare ((seq-index . sequencing-index)
@@ -4430,11 +4430,11 @@ Using `start' and `end' in either order should give the same result."
44304430
(loopy-deftest nunion-end-tracking-:at-start-twice
44314431
:result '(10 8 9 7 5 6 4 1 2 3)
44324432
:multi-body t
4433-
:body [(loopy (array i (vector (list 1 2 3) (list 1 2 3)
4434-
(list 4 5 6) (list 7 8 9)))
4435-
(nunion coll (copy-sequence i) :at start)
4436-
(nunion coll (mapcar #'1+ i) :at start)
4437-
(finally-return coll))
4433+
:body [((array i (vector (list 1 2 3) (list 1 2 3)
4434+
(list 4 5 6) (list 7 8 9)))
4435+
(nunion coll (copy-sequence i) :at start)
4436+
(nunion coll (mapcar #'1+ i) :at start)
4437+
(finally-return coll))
44384438

44394439
((array i (vector (list 1 2 3) (list 1 2 3)
44404440
(list 4 5 6) (list 7 8 9)))
@@ -4447,12 +4447,12 @@ Using `start' and `end' in either order should give the same result."
44474447

44484448
(loopy-deftest nunion-end-tracking-accum-opt-start-:at-end
44494449
:result '(1 2 3 4 5 6 7 8 9 10)
4450-
:body (loopy (accum-opt (coll start))
4451-
(array i (vector (list 1 2 3) (list 1 2 3)
4452-
(list 4 5 6) (list 7 8 9)))
4453-
(nunion coll (copy-sequence i) :at end)
4454-
(nunion coll (mapcar #'1+ i) :at end)
4455-
(finally-return coll))
4450+
:body ((accum-opt (coll start))
4451+
(array i (vector (list 1 2 3) (list 1 2 3)
4452+
(list 4 5 6) (list 7 8 9)))
4453+
(nunion coll (copy-sequence i) :at end)
4454+
(nunion coll (mapcar #'1+ i) :at end)
4455+
(finally-return coll))
44564456
:loopy t
44574457
:iter-keyword (array nunion)
44584458
:iter-bare ((array . arraying)
@@ -4461,12 +4461,12 @@ Using `start' and `end' in either order should give the same result."
44614461
;; TODO: Fail. Fix in optimized constructor, same as others.
44624462
(loopy-deftest nunion-end-tracking-accum-opt-end-:at-start
44634463
:result '(10 8 9 7 5 6 4 1 2 3)
4464-
:body (loopy (accum-opt (coll end))
4465-
(array i (vector (list 1 2 3) (list 1 2 3)
4466-
(list 4 5 6) (list 7 8 9)))
4467-
(nunion coll (copy-sequence i) :at start)
4468-
(nunion coll (mapcar #'1+ i) :at start)
4469-
(finally-return coll))
4464+
:body ((accum-opt (coll end))
4465+
(array i (vector (list 1 2 3) (list 1 2 3)
4466+
(list 4 5 6) (list 7 8 9)))
4467+
(nunion coll (copy-sequence i) :at start)
4468+
(nunion coll (mapcar #'1+ i) :at start)
4469+
(finally-return coll))
44704470
:loopy t
44714471
:iter-keyword (array nunion)
44724472
:iter-bare ((array . arraying)
@@ -4799,13 +4799,13 @@ This is how `cl-reduce' and `seq-reduce' work."
47994799
(loopy-deftest union-:key
48004800
:result '((a . 1))
48014801
:multi-body t
4802-
:body [(loopy (array i [((a . 1)) ((a . 2))])
4803-
(union var i :key #'car)
4804-
(finally-return var))
4802+
:body [((array i [((a . 1)) ((a . 2))])
4803+
(union var i :key #'car)
4804+
(finally-return var))
48054805

4806-
(loopy (with (func #'car))
4807-
(array i [((a . 1)) ((a . 2))])
4808-
(union i :key func))]
4806+
((with (func #'car))
4807+
(array i [((a . 1)) ((a . 2))])
4808+
(union i :key func))]
48094809
:loopy t
48104810
:iter-keyword (union array)
48114811
:iter-bare ((union . unioning)
@@ -4900,10 +4900,10 @@ This is how `cl-reduce' and `seq-reduce' work."
49004900
(union coll (mapcar (lambda (x) (+ x 10)) i) :at end)
49014901
(finally-return coll))
49024902

4903-
(loopy (list i '((1 2 3 4) (8 7 6 5)))
4904-
(union coll (mapcar (lambda (x) (+ x 10)) i) :at end)
4905-
(union coll i :at start)
4906-
(finally-return coll))
4903+
((list i '((1 2 3 4) (8 7 6 5)))
4904+
(union coll (mapcar (lambda (x) (+ x 10)) i) :at end)
4905+
(union coll i :at start)
4906+
(finally-return coll))
49074907

49084908
((list i '((1 2 3 4) (8 7 6 5)))
49094909
(union i :at start)
@@ -5382,9 +5382,9 @@ Not multiple of 3: 7"
53825382

53835383
(loopy-deftest always-multiple-commands
53845384
:result t
5385-
:body (loopy (list i '(1 3 5 7))
5386-
(always (cl-oddp i))
5387-
(always (< i 10)))
5385+
:body ((list i '(1 3 5 7))
5386+
(always (cl-oddp i))
5387+
(always (< i 10)))
53885388
:loopy t
53895389
:iter-keyword (list always)
53905390
:iter-bare ((list . listing)
@@ -5430,9 +5430,9 @@ Not multiple of 3: 7"
54305430

54315431
(loopy-deftest multiple-never
54325432
:result t
5433-
:body (loopy (list i '(1 3 5 7))
5434-
(never (cl-evenp i))
5435-
(never (> i 10)))
5433+
:body ((list i '(1 3 5 7))
5434+
(never (cl-evenp i))
5435+
(never (> i 10)))
54365436
:loopy t
54375437
:iter-keyword (list never)
54385438
:iter-bare ((list . listing)

0 commit comments

Comments
 (0)