Skip to content
Newer
Older
100644 46 lines (38 sloc) 559 Bytes
4551ec8 @VincentToups really tracked files.
authored Mar 28, 2012
1 (byte-compile-file "./shadchen.el" t)
2
3 ;; symbol
4 (assert
5 (equal
6 10
7 (match 10
8 (x x)))
9 ()
10 "symbol match failed.")
11
12 ;; string
13 (assert
14 (equal "test"
15 (match "test"
16 ("test" "test"))))
17
18 ;; string-fail
19 (assert
20 (equal :fail
21 (match "test"
22 ("dog" :pass)
23 (_ :fail))))
24
25 ;; list
26 (assert
27 (equal
28 (list 1 2 3)
29 (match (list 1 2 3)
30 ((list x y z)
31 (list x y z)))))
32
33
34 ;; lexical
35
36 ;; lexical-match symbol
37
38 (assert
39 (equal 10
40 (let
41 ((f
42 (lexical-match 10
43 (x
44 (lambda ()
45 x)))))
46 (funcall f))))
Something went wrong with that request. Please try again.