|
4 | 4 | (apply :update ipv4 "127.0.0.1" ["localhost" "localhost.local"])
|
5 | 5 |
|
6 | 6 | (assert (deep= (:hosts ipv4 "127.0.0.1") @["localhost" "localhost.local"])
|
7 |
| - "Hosts lookup by IP.") |
| 7 | + (string/format "Hosts lookup by IP: %q" ipv4)) |
8 | 8 |
|
9 | 9 | (assert (= (:ip ipv4 "localhost") "127.0.0.1")
|
10 |
| - "IP lookup by host.") |
| 10 | + (string/format "IP lookup by host: %q" ipv4)) |
11 | 11 |
|
12 | 12 | (assert (= (:hosts ipv4 "0.0.0.0") nil)
|
13 |
| - "Lookup unknown IP.") |
| 13 | + (string/format "Lookup unknown IP: %q" ipv4)) |
14 | 14 |
|
15 | 15 | (assert (= (:ip ipv4 "unknown") nil)
|
16 |
| - "Lookup unknown host.") |
| 16 | + (string/format "Lookup unknown host: %q" ipv4)) |
17 | 17 |
|
18 | 18 | (:update ipv4 "192.168.1.100" "hostname")
|
19 | 19 |
|
20 | 20 | (assert (deep= (:hosts ipv4 "192.168.1.100") @["hostname"])
|
21 |
| - "Hosts lookup by IP.") |
| 21 | + (string/format "Hosts lookup by IP: %q" ipv4)) |
22 | 22 |
|
23 | 23 | (assert (= (:ip ipv4 "hostname") "192.168.1.100")
|
24 |
| - "IP lookup by host.") |
| 24 | + (string/format "IP lookup by host: %q" ipv4)) |
25 | 25 |
|
26 | 26 | (assert (deep= (:hosts ipv4 "127.0.0.1") @["localhost" "localhost.local"])
|
27 |
| - "Hosts lookup by IP, after updating unrelated host.") |
| 27 | + (string/format "Hosts lookup by IP, after unrelated host: %q" ipv4)) |
28 | 28 |
|
29 | 29 | (assert (= (:ip ipv4 "localhost") "127.0.0.1")
|
30 |
| - "IP lookup by host, after updating unrelated host.") |
| 30 | + (string/format "IP lookup by host, after unrelated host: %q" ipv4)) |
31 | 31 |
|
32 | 32 | (apply :update ipv4 "127.0.1.1" ["hostname" "localhost.local"])
|
33 | 33 |
|
34 | 34 | (assert (deep= (:hosts ipv4 "127.0.1.1")
|
35 | 35 | @["hostname" "localhost" "localhost.local"])
|
36 |
| - "Hosts lookup by IP, after updating via alias.") |
| 36 | + (string/format "Hosts lookup by IP, after alias update: %q" ipv4)) |
37 | 37 |
|
38 | 38 | (assert (= (:ip ipv4 "localhost") "127.0.1.1")
|
39 |
| - "IP lookup by host, after updating via alias.") |
| 39 | + (string/format "IP lookup by host, after alias update: %q" ipv4)) |
40 | 40 |
|
41 | 41 | (assert (= (:hosts ipv4 "127.0.0.1") nil)
|
42 |
| - "Hosts lookup by original IP, after updating via alias.")) |
| 42 | + (string/format "Hosts lookup by old IP, after update: %q" ipv4))) |
43 | 43 |
|
44 | 44 | (let [int-tracker (tracker)]
|
45 | 45 | (assert (= (:seen? int-tracker 7) false)
|
46 |
| - "Checking a not-yet-seen value.") |
| 46 | + (string/format "Checking a not-yet-seen value: %q" int-tracker)) |
47 | 47 |
|
48 | 48 | (:see int-tracker 7)
|
49 | 49 |
|
50 | 50 | (assert (= (:seen? int-tracker 7) true)
|
51 |
| - "Checking a seen value.") |
| 51 | + (string/format "Checking a seen value: %q" int-tracker)) |
52 | 52 |
|
53 | 53 | (assert (= (:seen? int-tracker 42) false)
|
54 |
| - "Checking an unrelated value.")) |
| 54 | + (string/format "Checking an unrelated value: %q" int-tracker))) |
55 | 55 |
|
56 | 56 | (let [table-tracker (tracker hash)
|
57 | 57 | a-table @{7 "seven"}]
|
58 | 58 | (assert (= (:seen? table-tracker a-table) false)
|
59 |
| - "Checking a not-yet-seen value.") |
| 59 | + (string/format "Checking a not-yet-seen value: %q" table-tracker)) |
60 | 60 |
|
61 | 61 | (:see table-tracker a-table)
|
62 | 62 |
|
63 | 63 | (assert (= (:seen? table-tracker a-table) true)
|
64 |
| - "Checking a seen value.") |
| 64 | + (string/format "Checking a seen value: %q" table-tracker)) |
65 | 65 |
|
66 | 66 | (assert (= (:seen? table-tracker @{42 "forty-two" 7 "seven"}) false)
|
67 |
| - "Checking an unrelated value.")) |
| 67 | + (string/format "Checking an unrelated value: %q" table-tracker))) |
68 | 68 |
|
69 | 69 | (let [custom-tracker (tracker (fn [xs] (string/join xs "|")))]
|
70 | 70 | (assert (= (:seen? custom-tracker @["hello" "world"]) false)
|
71 |
| - "Checking a not-yet-seen value.") |
| 71 | + (string/format "Checking a not-yet-seen value: %q" custom-tracker)) |
72 | 72 |
|
73 | 73 | (:see custom-tracker @["hello" "world"])
|
74 | 74 |
|
75 | 75 | (assert (= (:seen? custom-tracker @["hello" "world"]) true)
|
76 |
| - "Checking a seen value.") |
| 76 | + (string/format "Checking a seen value: %q" custom-tracker)) |
77 | 77 |
|
78 | 78 | (assert (= (:seen? custom-tracker @["hello"]) false)
|
79 |
| - "Checking an unrelated value.")) |
| 79 | + (string/format "Checking an unrelated value: %q" custom-tracker))) |
0 commit comments