summaryrefslogtreecommitdiffstats
path: root/tests/012/oop-seq.tl
diff options
context:
space:
mode:
Diffstat (limited to 'tests/012/oop-seq.tl')
-rw-r--r--tests/012/oop-seq.tl17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/012/oop-seq.tl b/tests/012/oop-seq.tl
index e91564fc..17463e96 100644
--- a/tests/012/oop-seq.tl
+++ b/tests/012/oop-seq.tl
@@ -55,6 +55,23 @@
(test (list-seq (new counter-fast init 0 step 1 limit 0))
nil)
+(defstruct integers ()
+ item to next
+ (:method length-< (me len)
+ (cond
+ ((<= len 1) nil)
+ (me.next me.next.(length-< (pred len)))
+ (t)))
+ (:postinit (me)
+ (if (< me.item me.to)
+ (set me.next (lnew integers to me.to item (succ me.item))))))
+
+(let ((ints (new integers item 1 to 10)))
+ (mtest
+ (length-< ints 11) t)
+ (length-< ints 10) nil
+ (length-< ints 9) nil)
+
;; The following reproduced a segfault when the change was made to allow del to
;; work with structs that have lambda and lambda-set.