Skip to content

Commit 1e9e15b

Browse files
authored
Update tests variable length quantity (#2728)
* Sync test.toml * Update test files * Update config.json * verify hexa values
1 parent bb934d9 commit 1e9e15b

File tree

3 files changed

+72
-29
lines changed

3 files changed

+72
-29
lines changed

exercises/practice/variable-length-quantity/.meta/config.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"contributors": [
66
"ankorGH",
77
"hayashi-ay",
8+
"jagdish-15",
89
"SleeplessByte",
910
"smb26"
1011
],
Lines changed: 51 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,81 +1,103 @@
1-
# This is an auto-generated file. Regular comments will be removed when this
2-
# file is regenerated. Regenerating will not touch any manually added keys,
3-
# so comments can be added in a "comment" key.
1+
# This is an auto-generated file.
2+
#
3+
# Regenerating this file via `configlet sync` will:
4+
# - Recreate every `description` key/value pair
5+
# - Recreate every `reimplements` key/value pair, where they exist in problem-specifications
6+
# - Remove any `include = true` key/value pair (an omitted `include` key implies inclusion)
7+
# - Preserve any other key/value pair
8+
#
9+
# As user-added comments (using the # character) will be removed when this file
10+
# is regenerated, comments can be added via a `comment` key.
411

512
[35c9db2e-f781-4c52-b73b-8e76427defd0]
6-
description = "zero"
13+
description = "Encode a series of integers, producing a series of bytes. -> zero"
714

815
[be44d299-a151-4604-a10e-d4b867f41540]
9-
description = "arbitrary single byte"
16+
description = "Encode a series of integers, producing a series of bytes. -> arbitrary single byte"
17+
18+
[890bc344-cb80-45af-b316-6806a6971e81]
19+
description = "Encode a series of integers, producing a series of bytes. -> asymmetric single byte"
1020

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

1424
[77b07086-bd3f-4882-8476-8dcafee79b1c]
15-
description = "smallest double byte"
25+
description = "Encode a series of integers, producing a series of bytes. -> smallest double byte"
1626

1727
[63955a49-2690-4e22-a556-0040648d6b2d]
18-
description = "arbitrary double byte"
28+
description = "Encode a series of integers, producing a series of bytes. -> arbitrary double byte"
29+
30+
[4977d113-251b-4d10-a3ad-2f5a7756bb58]
31+
description = "Encode a series of integers, producing a series of bytes. -> asymmetric double byte"
1932

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

2336
[3345d2e3-79a9-4999-869e-d4856e3a8e01]
24-
description = "smallest triple byte"
37+
description = "Encode a series of integers, producing a series of bytes. -> smallest triple byte"
2538

2639
[5df0bc2d-2a57-4300-a653-a75ee4bd0bee]
27-
description = "arbitrary triple byte"
40+
description = "Encode a series of integers, producing a series of bytes. -> arbitrary triple byte"
41+
42+
[6731045f-1e00-4192-b5ae-98b22e17e9f7]
43+
description = "Encode a series of integers, producing a series of bytes. -> asymmetric triple byte"
2844

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

3248
[da78228b-544f-47b7-8bfe-d16b35bbe570]
33-
description = "smallest quadruple byte"
49+
description = "Encode a series of integers, producing a series of bytes. -> smallest quadruple byte"
3450

3551
[11ed3469-a933-46f1-996f-2231e05d7bb6]
36-
description = "arbitrary quadruple byte"
52+
description = "Encode a series of integers, producing a series of bytes. -> arbitrary quadruple byte"
53+
54+
[b45ef770-cbba-48c2-bd3c-c6362679516e]
55+
description = "Encode a series of integers, producing a series of bytes. -> asymmetric quadruple byte"
3756

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

4160
[91a18b33-24e7-4bfb-bbca-eca78ff4fc47]
42-
description = "smallest quintuple byte"
61+
description = "Encode a series of integers, producing a series of bytes. -> smallest quintuple byte"
4362

4463
[5f34ff12-2952-4669-95fe-2d11b693d331]
45-
description = "arbitrary quintuple byte"
64+
description = "Encode a series of integers, producing a series of bytes. -> arbitrary quintuple byte"
65+
66+
[9be46731-7cd5-415c-b960-48061cbc1154]
67+
description = "Encode a series of integers, producing a series of bytes. -> asymmetric quintuple byte"
4668

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

5072
[f9b91821-cada-4a73-9421-3c81d6ff3661]
51-
description = "two single-byte values"
73+
description = "Encode a series of integers, producing a series of bytes. -> two single-byte values"
5274

5375
[68694449-25d2-4974-ba75-fa7bb36db212]
54-
description = "two multi-byte values"
76+
description = "Encode a series of integers, producing a series of bytes. -> two multi-byte values"
5577

5678
[51a06b5c-de1b-4487-9a50-9db1b8930d85]
57-
description = "many multi-byte values"
79+
description = "Encode a series of integers, producing a series of bytes. -> many multi-byte values"
5880

5981
[baa73993-4514-4915-bac0-f7f585e0e59a]
60-
description = "one byte"
82+
description = "Decode a series of bytes, producing a series of integers. -> one byte"
6183

6284
[72e94369-29f9-46f2-8c95-6c5b7a595aee]
63-
description = "two bytes"
85+
description = "Decode a series of bytes, producing a series of integers. -> two bytes"
6486

6587
[df5a44c4-56f7-464e-a997-1db5f63ce691]
66-
description = "three bytes"
88+
description = "Decode a series of bytes, producing a series of integers. -> three bytes"
6789

6890
[1bb58684-f2dc-450a-8406-1f3452aa1947]
69-
description = "four bytes"
91+
description = "Decode a series of bytes, producing a series of integers. -> four bytes"
7092

7193
[cecd5233-49f1-4dd1-a41a-9840a40f09cd]
72-
description = "maximum 32-bit integer"
94+
description = "Decode a series of bytes, producing a series of integers. -> maximum 32-bit integer"
7395

7496
[e7d74ba3-8b8e-4bcb-858d-d08302e15695]
75-
description = "incomplete sequence causes error"
97+
description = "Decode a series of bytes, producing a series of integers. -> incomplete sequence causes error"
7698

7799
[aa378291-9043-4724-bc53-aca1b4a3fcb6]
78-
description = "incomplete sequence causes error, even if value is zero"
100+
description = "Decode a series of bytes, producing a series of integers. -> incomplete sequence causes error, even if value is zero"
79101

80102
[a91e6f5a-c64a-48e3-8a75-ce1a81e0ebee]
81-
description = "multiple values"
103+
description = "Decode a series of bytes, producing a series of integers. -> multiple values"

exercises/practice/variable-length-quantity/variable-length-quantity.spec.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ describe('VariableLengthQuantity', () => {
1111
expect(encode([0x40])).toEqual([0x40]);
1212
});
1313

14+
xtest('asymmetric single byte', () => {
15+
expect(encode([0x53])).toEqual([0x53]);
16+
});
17+
1418
xtest('largest single byte', () => {
1519
expect(encode([0x7f])).toEqual([0x7f]);
1620
});
@@ -23,6 +27,10 @@ describe('VariableLengthQuantity', () => {
2327
expect(encode([0x2000])).toEqual([0xc0, 0]);
2428
});
2529

30+
xtest('asymmetric double byte', () => {
31+
expect(encode([0xad])).toEqual([0x81, 0x2d]);
32+
});
33+
2634
xtest('largest double byte', () => {
2735
expect(encode([0x3fff])).toEqual([0xff, 0x7f]);
2836
});
@@ -35,6 +43,10 @@ describe('VariableLengthQuantity', () => {
3543
expect(encode([0x100000])).toEqual([0xc0, 0x80, 0]);
3644
});
3745

46+
xtest('asymmetric triple byte', () => {
47+
expect(encode([0x1d59c])).toEqual([0x87, 0xab, 0x1c]);
48+
});
49+
3850
xtest('largest triple byte', () => {
3951
expect(encode([0x1fffff])).toEqual([0xff, 0xff, 0x7f]);
4052
});
@@ -47,6 +59,10 @@ describe('VariableLengthQuantity', () => {
4759
expect(encode([0x8000000])).toEqual([0xc0, 0x80, 0x80, 0]);
4860
});
4961

62+
xtest('asymmetric quadruple byte', () => {
63+
expect(encode([0x357704])).toEqual([0x81, 0xd5, 0xee, 0x04]);
64+
});
65+
5066
xtest('largest quadruple byte', () => {
5167
expect(encode([0xfffffff])).toEqual([0xff, 0xff, 0xff, 0x7f]);
5268
});
@@ -59,6 +75,10 @@ describe('VariableLengthQuantity', () => {
5975
expect(encode([0xff000000])).toEqual([0x8f, 0xf8, 0x80, 0x80, 0]);
6076
});
6177

78+
xtest('asymmetric quintuple byte', () => {
79+
expect(encode([0x86656105])).toEqual([0x88, 0xb3, 0x95, 0xc2, 0x05]);
80+
});
81+
6282
xtest('maximum 32-bit integer input', () => {
6383
expect(encode([0xffffffff])).toEqual([0x8f, 0xff, 0xff, 0xff, 0x7f]);
6484
});

0 commit comments

Comments
 (0)