Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 58 lines (47 sloc) 1.557 kB
1a5958e first commit
George Jahad authored
1 # difform
2
3 Diffs two clojure forms, eg:
4
5 (use 'com.georgejahad.difform)
fc1eb08 @GeorgeJahad fixed docs
authored
6 (difform { 1 2 3 4 5 6} { 5 6 1 2 3 7})
7 {1 2, 3
8 - 4
1a5958e first commit
George Jahad authored
9 + 7
fc1eb08 @GeorgeJahad fixed docs
authored
10 , 5 6}
1a5958e first commit
George Jahad authored
11
12 (difform
13
14 {:cart {:items [{:new-delivery {:ids ["-1"]}, :old-unit-price "700.00", :product-id "prod-1", :quantity "1", :unit-price "700.00"}], :old-total-dollars "700.00", :purchase? false, :total-dollars "700.00"}, :day "2010-05-18", :event-ids ["1274166000010:some-session-id-1"], :old-id "14", :delivery {:ids [nil]}, :session "some-session-id-1"}
15
16 {:day "2010-05-18", :old-id "14", :session "some-session-id-1", :delivery nil, :cart {:purchase? false, :old-total-dollars "1400.00", :total-dollars "1400.00", :items [{:product-id "prod-1", :old-unit-price "700.00", :unit-price "700.00", :quantity "2", :new-delivery {:ids ["-1"]}}]}, :event-ids ["1274166000000:some-session-id-1"]})
17
18
19 {:cart
20 {:items
21 [{:new-delivery {:ids ["-1"]},
22 :old-unit-price "700.00",
23 :product-id "prod-1",
24 :quantity "
25 - 1
26 + 2
27 ",
28 :unit-price "700.00"}],
29 :old-total-dollars "
30 - 7
31 + 14
32 00.00",
33 :purchase? false,
34 :total-dollars "
35 - 7
36 + 14
37 00.00"},
38 :day "2010-05-18",
39 :delivery
40 - {:ids [
41 nil
42 - ]}
43 ,
44 :event-ids ["1274166
45 + 0
46 0000
47 - 1
48 0:some-session-id-1"],
49 :old-id "14",
50 :session "some-session-id-1"}
51
52 A very common use is with clojure.test. For example, if clojure test reports you have failed a test like this:
53
54 FAIL in (xyz-test) (xyz_spec.clj:7)
55 expected: (= form1 form2)
56
fc1eb08 @GeorgeJahad fixed docs
authored
57 Run (diff form1 form2) to see what the exact failure was.
Something went wrong with that request. Please try again.