Skip to content

Commit bc17626

Browse files
committed
fix params, drop-last, get and trim
1 parent c7d6a31 commit bc17626

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/practitest_firecracker/practitest.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@
263263
(map
264264
(fn [test-name]
265265
{test-name
266-
[(into {} (difference (set (get new-map test-name)) (set (get existing-instance test-name))))]})
266+
(into [] (difference (set (get new-map test-name)) (set (get existing-instance test-name))))})
267267
(keys new-map)))
268268

269269
make-instances (flatten (api/make-instances missing-instances new-testname-to-params test-id-testname))

src/practitest_firecracker/query_dsl.cljc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
(return-error "Syntax error: 'drop' must have two arguments" query))
5353
'drop-last (if (<= 1 (count args) 2)
5454
(if (or (string? (last args)) (coll? (last args)))
55-
(apply drop-last args)
55+
(drop-last (parse-int (first args)) (last args))
5656
(return-error "Syntax error: 'drop-last' second argument has to be ISeqable (String, Array etc.)" query))
5757
(return-error "Syntax error: 'drop-last' must have one or two arguments" query))
5858
'take-last (case (count args)
@@ -78,12 +78,12 @@
7878
(string/split (second args) complied)))
7979
(return-error "Syntax error: 'split' must have two arguments" query))
8080
'get (if (= 2 (count args))
81-
(first (take 1 (drop (- (parse-int (first args)) 1) (last args))))
81+
(string/join (get (last args) (dec (parse-int (first args)))))
8282
(return-error "Syntax error: 'get' must have two arguments" query))
8383
'trim (if (= 1 (count args))
8484
(if (string? (first args))
8585
(string/trim (first args))
86-
(return-error "Syntax error: 'trim' should be applied on a string" query))
86+
"")
8787
(return-error "Syntax error: 'trim' must have only one argument" query))
8888
(return-error #?(:clj (format "Syntax error: unsupported function '%s'" op)
8989
:cljs (str "Syntax error: unsupported function: " op)) query)))

0 commit comments

Comments
 (0)