git.fiddlerwoaroof.com
Browse code

Test hash table parsing

Fernando Borretti authored on 30/03/2015 20:52:33
Showing 1 changed files
... ...
@@ -63,11 +63,24 @@
63 63
      (equal data
64 64
             (list 1 2 3)))))
65 65
 
66
+(test hash-tables
67
+  (let ((data (yaml:parse "{ a: 1, b: 2}")))
68
+    (is
69
+     (equal (hash-table-count data)
70
+            2))
71
+    (is-false
72
+     (set-difference (alexandria:hash-table-keys data)
73
+                     (list "a" "b")
74
+                     :test #'equal))
75
+    (is-false
76
+     (set-difference (alexandria:hash-table-values data)
77
+                     (list 1 2)))))
78
+
66 79
 (test parsing-errors
67 80
   (signals yaml.error:parsing-error
68 81
     (yaml:parse "[1,2,3")))
69 82
 
70
-(test toplevel-parser
83
+(test parse-file
71 84
   (is
72 85
    (equal (yaml:parse (asdf:system-relative-pathname :cl-yaml #p"t/test.yaml"))
73 86
           (list 1 2 3))))