Skip to content

Commit

Permalink
test: Add test exercising CSV-writing code
Browse files Browse the repository at this point in the history
  • Loading branch information
Zane Shelby authored and zane committed Jun 12, 2024
1 parent e069b2e commit a66976b
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test/gensql/query/main_test.clj
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
(ns gensql.query.main-test
(:refer-clojure :exclude [eval])
(:require [clojure.java.io :as io]
[clojure.test :refer [deftest is]]
[gensql.query.io :as query.io]
[gensql.query.main :as main]
[gensql.query.relation :as relation]))

(deftest print-csv-round-trip
(let [input (relation/relation [{"x" 0 "y" 1}])
csv-str (with-out-str (main/print-csv input))
output (query.io/slurp-csv (io/reader (char-array csv-str)))]
(is (= input output))))

0 comments on commit a66976b

Please sign in to comment.