Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions exercises/practice/variable-length-quantity/.meta/tests.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ description = "Encode a series of integers, producing a series of bytes. -> zero
[be44d299-a151-4604-a10e-d4b867f41540]
description = "Encode a series of integers, producing a series of bytes. -> arbitrary single byte"

[890bc344-cb80-45af-b316-6806a6971e81]
description = "Encode a series of integers, producing a series of bytes. -> asymmetric single byte"

[ea399615-d274-4af6-bbef-a1c23c9e1346]
description = "Encode a series of integers, producing a series of bytes. -> largest single byte"

Expand All @@ -24,6 +27,9 @@ description = "Encode a series of integers, producing a series of bytes. -> smal
[63955a49-2690-4e22-a556-0040648d6b2d]
description = "Encode a series of integers, producing a series of bytes. -> arbitrary double byte"

[4977d113-251b-4d10-a3ad-2f5a7756bb58]
description = "Encode a series of integers, producing a series of bytes. -> asymmetric double byte"

[29da7031-0067-43d3-83a7-4f14b29ed97a]
description = "Encode a series of integers, producing a series of bytes. -> largest double byte"

Expand All @@ -33,6 +39,9 @@ description = "Encode a series of integers, producing a series of bytes. -> smal
[5df0bc2d-2a57-4300-a653-a75ee4bd0bee]
description = "Encode a series of integers, producing a series of bytes. -> arbitrary triple byte"

[6731045f-1e00-4192-b5ae-98b22e17e9f7]
description = "Encode a series of integers, producing a series of bytes. -> asymmetric triple byte"

[f51d8539-312d-4db1-945c-250222c6aa22]
description = "Encode a series of integers, producing a series of bytes. -> largest triple byte"

Expand All @@ -42,6 +51,9 @@ description = "Encode a series of integers, producing a series of bytes. -> smal
[11ed3469-a933-46f1-996f-2231e05d7bb6]
description = "Encode a series of integers, producing a series of bytes. -> arbitrary quadruple byte"

[b45ef770-cbba-48c2-bd3c-c6362679516e]
description = "Encode a series of integers, producing a series of bytes. -> asymmetric quadruple byte"

[d5f3f3c3-e0f1-4e7f-aad0-18a44f223d1c]
description = "Encode a series of integers, producing a series of bytes. -> largest quadruple byte"

Expand All @@ -51,6 +63,9 @@ description = "Encode a series of integers, producing a series of bytes. -> smal
[5f34ff12-2952-4669-95fe-2d11b693d331]
description = "Encode a series of integers, producing a series of bytes. -> arbitrary quintuple byte"

[9be46731-7cd5-415c-b960-48061cbc1154]
description = "Encode a series of integers, producing a series of bytes. -> asymmetric quintuple byte"

[7489694b-88c3-4078-9864-6fe802411009]
description = "Encode a series of integers, producing a series of bytes. -> maximum 32-bit integer input"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
(should (equal (encode '(#x40)) '(#x40))))


(ert-deftest asymmetric-single-byte ()
(should (equal (encode '(#x53)) '(#x53))))


(ert-deftest largest-single-byte ()
(should (equal (encode '(#x7F)) '(#x7F))))

Expand All @@ -30,6 +34,10 @@
(should (equal (encode '(#x2000)) '(#xC0 #x0))))


(ert-deftest asymmetric-double-byte ()
(should (equal (encode '(#xAD)) '(#x81 #x2D))))


(ert-deftest largest-double-byte ()
(should (equal (encode '(#x3FFF)) '(#xFF #x7F))))

Expand All @@ -42,6 +50,10 @@
(should (equal (encode '(#x100000)) '(#xC0 #x80 #x0))))


(ert-deftest asymmetric-triple-byte ()
(should (equal (encode '(#x1D59C)) '(#x87 #xAB #x1C))))


(ert-deftest largest-triple-byte ()
(should (equal (encode '(#x1FFFFF)) '(#xFF #xFF #x7F))))

Expand All @@ -54,6 +66,10 @@
(should (equal (encode '(#x8000000)) '(#xC0 #x80 #x80 #x0))))


(ert-deftest asymmetric-quadruple-byte ()
(should (equal (encode '(#x357704)) '(#x81 #xD5 #xEE #x4))))


(ert-deftest largest-quadruple-byte ()
(should (equal (encode '(#xFFFFFFF)) '(#xFF #xFF #xFF #x7F))))

Expand All @@ -66,6 +82,10 @@
(should (equal (encode '(#xFF000000)) '(#x8F #xF8 #x80 #x80 #x0))))


(ert-deftest asymmetric-quintuple-byte ()
(should (equal (encode '(#x86656105)) '(#x88 #xB3 #x95 #xC2 #x5))))


(ert-deftest maximum-32-bit-integer-input ()
(should (equal (encode '(#xFFFFFFFF)) '(#x8F #xFF #xFF #xFF #x7F))))

Expand Down