Merge pull request #49 from MichaelBlume/expected-first

in unit test, put expected value first
This commit is contained in:
Michael Blume 2015-03-03 20:23:31 -08:00
commit b621273fd2

View file

@ -50,9 +50,9 @@
(testing "Various construction methods are consistent" (testing "Various construction methods are consistent"
(is (= m1 m3))) (is (= m1 m3)))
(testing "SQL data formats correctly" (testing "SQL data formats correctly"
(is (= (sql/format m1 {:param1 "gabba" :param2 2}) (is (= ["SELECT DISTINCT f.*, b.baz, c.quux, b.bla AS bla_bla, now(), @x := 10 FROM foo f, baz b INNER JOIN draq ON f.b = draq.x LEFT JOIN clod c ON f.a = c.d RIGHT JOIN bock ON bock.z = c.e WHERE ((f.a = ? AND b.baz <> ?) OR (1 < 2 AND 2 < 3) OR (f.e in (1, ?, 3)) OR f.e BETWEEN 10 AND 20) GROUP BY f.a HAVING 0 < f.e ORDER BY b.baz DESC, c.quux LIMIT 50 OFFSET 10 "
["SELECT DISTINCT f.*, b.baz, c.quux, b.bla AS bla_bla, now(), @x := 10 FROM foo f, baz b INNER JOIN draq ON f.b = draq.x LEFT JOIN clod c ON f.a = c.d RIGHT JOIN bock ON bock.z = c.e WHERE ((f.a = ? AND b.baz <> ?) OR (1 < 2 AND 2 < 3) OR (f.e in (1, ?, 3)) OR f.e BETWEEN 10 AND 20) GROUP BY f.a HAVING 0 < f.e ORDER BY b.baz DESC, c.quux LIMIT 50 OFFSET 10 " "bort" "gabba" 2]
"bort" "gabba" 2]))) (sql/format m1 {:param1 "gabba" :param2 2}))))
(testing "SQL data prints and reads correctly" (testing "SQL data prints and reads correctly"
(is (= m1 (read-string (pr-str m1))))))) (is (= m1 (read-string (pr-str m1)))))))