;;; Type your name and student ID here. (use 'clojure.test) (defn pandigital? [n] nil) (defn medal-sort [lst] nil) (defmacro aif [variable condition-part then-part else-part] nil) (deftest test-pandigital? (is (pandigital? 1023456789)) (is (pandigital? 5897230146)) (is (pandigital? 10123485679)) (is (pandigital? 1223334444555566666677777778888888889999999990)) (is (not (pandigital? 1236))) (is (not (pandigital? 1112223334455))) (is (not (pandigital? 587230462413578))) (is (not (pandigital? 122333444455556666667777777888888888999999999)))) (deftest test-medal-sort (is (let [countries-unsorted '({:country "Mexico", :gold 1, :silver 3, :bronze 3} {:country "Kuwait", :gold 0, :silver 0, :bronze 1} {:country "Georgia", :gold 1, :silver 3, :bronze 3} {:country "Colombia", :gold 1, :silver 3, :bronze 4} {:country "China", :gold 38, :silver 27, :bronze 23} {:country "Slovenia", :gold 1, :silver 1, :bronze 2} {:country "Argentina", :gold 1, :silver 1, :bronze 2} {:country "Hong Kong", :gold 0, :silver 0, :bronze 1} {:country "Francia", :gold 11, :silver 11, :bronze 12} {:country "Afghanistan ", :gold 0, :silver 0, :bronze 1} {:country "Tajikistan", :gold 0, :silver 0, :bronze 1} {:country "Germany", :gold 11, :silver 19, :bronze 14} {:country "Great Britain", :gold 29, :silver 17, :bronze 19} {:country "United States", :gold 46, :silver 29, :bronze 29}) countries-sorted '({:country "United States", :gold 46, :silver 29, :bronze 29} {:country "China", :gold 38, :silver 27, :bronze 23} {:country "Great Britain", :gold 29, :silver 17, :bronze 19} {:country "Germany", :gold 11, :silver 19, :bronze 14} {:country "Francia", :gold 11, :silver 11, :bronze 12} {:country "Colombia", :gold 1, :silver 3, :bronze 4} {:country "Georgia", :gold 1, :silver 3, :bronze 3} {:country "Mexico", :gold 1, :silver 3, :bronze 3} {:country "Argentina", :gold 1, :silver 1, :bronze 2} {:country "Slovenia", :gold 1, :silver 1, :bronze 2} {:country "Afghanistan ", :gold 0, :silver 0, :bronze 1} {:country "Hong Kong", :gold 0, :silver 0, :bronze 1} {:country "Kuwait", :gold 0, :silver 0, :bronze 1} {:country "Tajikistan", :gold 0, :silver 0, :bronze 1})] (= countries-sorted (medal-sort countries-unsorted))))) (deftest test-aif (is (= '(clojure.core/let [q (first '(4 8 15))] (if q (inc q) (list q))) (macroexpand-1 '(aif q (first '(4 8 15)) (inc q) (list q))))) (is (= 5 (aif q (first '(4 8 15)) (inc q) (list q)))) (is (= '(clojure.core/let [info (seq ())] (if info (first info) (list info))) (macroexpand-1 '(aif info (seq ()) (first info) (list info))))) (is (= '(nil) (aif info (seq ()) (first info) (list info))))) (run-tests)