Skip to content

Commit

Permalink
Added tests to previous commit.
Browse files Browse the repository at this point in the history
  • Loading branch information
vdim committed Jan 25, 2013
1 parent 5569482 commit c6d2938
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion test/src/ru/petrsu/nest/yz/queries/params.clj
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
;;
;; Copyright 2012 Vyacheslav Dimitrov <vyacheslav.dimitrov@gmail.com>
;; Copyright 2012-2013 Vyacheslav Dimitrov <vyacheslav.dimitrov@gmail.com>
;;
;; This file is part of YZ.
;;
Expand Down Expand Up @@ -162,4 +162,19 @@
[bd/r101_f1_b1 [] bd/r1001_f1_b2 []])))


; Query with parameter and the "!=" function.
(defq ^{:mom bd/bd-mom, :em bd/mem} q15 "floor#(number != $1)")

(deftest t-q15
(let [f #(is (tc/eq-results? (:result (q15 %1)) %2))]
(f 1 [bd/f2_b1 [] bd/f3_b1 []])
(f 2 [bd/f1_b1 [] bd/f3_b1 [] bd/f1_b2 []])))


; Query with parameter and the ">" function.
(defq ^{:mom bd/bd-mom, :em bd/mem} q16 "floor#(number > $1)")

(deftest t-q16
(let [f #(is (tc/eq-results? (:result (q16 %1)) %2))]
(f 1 [bd/f2_b1 [] bd/f3_b1 []])
(f 2 [bd/f3_b1 []])))

0 comments on commit c6d2938

Please sign in to comment.