summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2012-02-22 19:01:10 -0800
committerKaz Kylheku <kaz@kylheku.com>2012-02-22 19:01:10 -0800
commitc4b87400ed9fb160ba5b282f1b58c62c057cbd50 (patch)
tree7925a6c97a3be3d3d1d55dca0d20d8f93add3a02 /tests
parent1072417ca13b56e338b88fd2389b3b25861c6193 (diff)
downloadtxr-c4b87400ed9fb160ba5b282f1b58c62c057cbd50.tar.gz
txr-c4b87400ed9fb160ba5b282f1b58c62c057cbd50.tar.bz2
txr-c4b87400ed9fb160ba5b282f1b58c62c057cbd50.zip
* tests/010/seq.txr: New file.
* tests/010/seq.expected: New file.
Diffstat (limited to 'tests')
-rw-r--r--tests/010/seq.expected12
-rw-r--r--tests/010/seq.txr21
2 files changed, 33 insertions, 0 deletions
diff --git a/tests/010/seq.expected b/tests/010/seq.expected
new file mode 100644
index 00000000..73009319
--- /dev/null
+++ b/tests/010/seq.expected
@@ -0,0 +1,12 @@
+42
+42
+42
+nil
+#\b "acd"
+#\d "ac"
+exception!
+exception!
+#(8 7 6 5 4 3 2 1)
+#((7 . #\h) (8 . #\g) (6 . #\f) (5 . #\e) (4 . #\d) (3 . #\c) (2 . #\b) (1 . #\a))
+(100 99 98 97 96 95 94 93 92 91 90 89 88 87 86 85 84 83 82 81 80 79 78 77 76 75 74 73 72 71 70 69 68 67 66 65 64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1)
+#((8 . #\g) (6 . #\f)) #((7 . #\h) (5 . #\e) (4 . #\d) (3 . #\c) (2 . #\b) (1 . #\a))
diff --git a/tests/010/seq.txr b/tests/010/seq.txr
new file mode 100644
index 00000000..2983447d
--- /dev/null
+++ b/tests/010/seq.txr
@@ -0,0 +1,21 @@
+@(do
+ (defvar *h* (hash :equal-based))
+ (defvar *s* "abcd")
+ (defvar *v* #(1 2 3 4 5 6 7 8))
+ (defvar *v2* #((1 . #\a) (2 . #\b) (3 . #\c) (4 . #\d)
+ (5 . #\e) (6 . #\f) (7 . #\h) (8 . #\g)))
+ (defun caught (x) (format t "exception!\n"))
+ (defun pr (x) (format t "~s\n" x))
+ (defun pr2 (x y) (format t "~s ~s\n" x y))
+ (pr (set [*h* "a"] 42))
+ (pr [*h* "a"])
+ (pr (del [*h* "a"]))
+ (pr (del [*h* "a"]))
+ (format t "~s ~s\n" (del [*s* 1]) *s*)
+ (format t "~s ~s\n" (del [*s* -1]) *s*)
+ (catch (pr (del [*s* 3]) *s*) (t (x) (caught x)))
+ (catch (del *h*) (t (x) (caught x)))
+ (pr [sort *v* >])
+ (pr [sort *v2* > cdr])
+ (pr [sort (range 1 100) >])
+ (pr2 (del [*v2* 1..3]) *v2*))