Skip to content

Commit c73935d

Browse files
committed
Rename functions
1 parent b3e7d41 commit c73935d

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/io/aviso/binary.clj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
(for [i (range line-count)]
4040
(format " %02X" (byte-at data (+ offset i)))))))
4141

42-
(defn format-byte-data
42+
(defn format-binary
4343
"Formats a ByteData into a hex-dump string, consisting of multiple lines; each line formatted as:
4444
4545
0000: 4E 6F 77 20 69 73 20 74 68 65 20 74 69 6D 65 20 66 6F 72 20 61 6C 6C 20 67 6F 6F 64 20 6D 65 6E
@@ -98,7 +98,7 @@
9898
(format-byte-deltas ansi/bold-green true offset expected-length expected actual-length actual)
9999
(format-byte-deltas ansi/bold-red false offset actual-length actual expected-length expected))))
100100

101-
(defn format-byte-delta
101+
(defn format-binary-delta
102102
"Formats a hex dump of the expected data (on the left) and actual data (on the right). Bytes
103103
that do not match are highlighted in green on the expected side, and red on the actual side.
104104
When one side is shorter than the other, it is padded with -- placeholders to make this

test/io/aviso/binary_test.clj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
clojure.test))
55

66
(defn- format-string-as-byte-array [str]
7-
(format-byte-data (.getBytes str)))
7+
(format-binary (.getBytes str)))
88

99
(deftest format-byte-array-test
1010

@@ -17,11 +17,11 @@
1717

1818
(deftest format-string-as-byte-data
1919
(are [input output]
20-
(= (format-byte-data input) output)
20+
(= (format-binary input) output)
2121
"" ""
2222
"Hello" "0000: 48 65 6C 6C 6F\n"
2323
"This is a longer text that spans to a second line."
2424
"0000: 54 68 69 73 20 69 73 20 61 20 6C 6F 6E 67 65 72 20 74 65 78 74 20 74 68 61 74 20 73 70 61 6E 73\n0020: 20 74 6F 20 61 20 73 65 63 6F 6E 64 20 6C 69 6E 65 2E\n"))
2525

2626
(deftest nil-is-an-empty-data
27-
(is (= (format-byte-data nil) "")))
27+
(is (= (format-binary nil) "")))

0 commit comments

Comments
 (0)