Skip to content

Commit 2ddd946

Browse files
committed
Sync variable-length-quantity tests
1 parent a98c6e8 commit 2ddd946

File tree

2 files changed

+81
-26
lines changed

2 files changed

+81
-26
lines changed

exercises/practice/variable-length-quantity/.meta/tests.toml

Lines changed: 41 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -10,79 +10,94 @@
1010
# is regenerated, comments can be added via a `comment` key.
1111

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

1515
[be44d299-a151-4604-a10e-d4b867f41540]
16-
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"
1720

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

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

2427
[63955a49-2690-4e22-a556-0040648d6b2d]
25-
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"
2632

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

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

3339
[5df0bc2d-2a57-4300-a653-a75ee4bd0bee]
34-
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"
3544

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

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

4251
[11ed3469-a933-46f1-996f-2231e05d7bb6]
43-
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"
4456

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

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

5163
[5f34ff12-2952-4669-95fe-2d11b693d331]
52-
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"
5368

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

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

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

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

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

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

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

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

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

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

8499
[aa378291-9043-4724-bc53-aca1b4a3fcb6]
85-
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"
86101

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

exercises/practice/variable-length-quantity/VariableLengthQuantityTests.cs

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,14 @@ public void Encode_a_series_of_integers_producing_a_series_of_bytes_arbitrary_si
1616
Assert.Equal(expected, VariableLengthQuantity.Encode(integers));
1717
}
1818

19+
[Fact(Skip = "Remove this Skip property to run this test")]
20+
public void Encode_a_series_of_integers_producing_a_series_of_bytes_asymmetric_single_byte()
21+
{
22+
uint[] integers = [83];
23+
uint[] expected = [83];
24+
Assert.Equal(expected, VariableLengthQuantity.Encode(integers));
25+
}
26+
1927
[Fact(Skip = "Remove this Skip property to run this test")]
2028
public void Encode_a_series_of_integers_producing_a_series_of_bytes_largest_single_byte()
2129
{
@@ -40,6 +48,14 @@ public void Encode_a_series_of_integers_producing_a_series_of_bytes_arbitrary_do
4048
Assert.Equal(expected, VariableLengthQuantity.Encode(integers));
4149
}
4250

51+
[Fact(Skip = "Remove this Skip property to run this test")]
52+
public void Encode_a_series_of_integers_producing_a_series_of_bytes_asymmetric_double_byte()
53+
{
54+
uint[] integers = [173];
55+
uint[] expected = [129, 45];
56+
Assert.Equal(expected, VariableLengthQuantity.Encode(integers));
57+
}
58+
4359
[Fact(Skip = "Remove this Skip property to run this test")]
4460
public void Encode_a_series_of_integers_producing_a_series_of_bytes_largest_double_byte()
4561
{
@@ -64,6 +80,14 @@ public void Encode_a_series_of_integers_producing_a_series_of_bytes_arbitrary_tr
6480
Assert.Equal(expected, VariableLengthQuantity.Encode(integers));
6581
}
6682

83+
[Fact(Skip = "Remove this Skip property to run this test")]
84+
public void Encode_a_series_of_integers_producing_a_series_of_bytes_asymmetric_triple_byte()
85+
{
86+
uint[] integers = [120220];
87+
uint[] expected = [135, 171, 28];
88+
Assert.Equal(expected, VariableLengthQuantity.Encode(integers));
89+
}
90+
6791
[Fact(Skip = "Remove this Skip property to run this test")]
6892
public void Encode_a_series_of_integers_producing_a_series_of_bytes_largest_triple_byte()
6993
{
@@ -88,6 +112,14 @@ public void Encode_a_series_of_integers_producing_a_series_of_bytes_arbitrary_qu
88112
Assert.Equal(expected, VariableLengthQuantity.Encode(integers));
89113
}
90114

115+
[Fact(Skip = "Remove this Skip property to run this test")]
116+
public void Encode_a_series_of_integers_producing_a_series_of_bytes_asymmetric_quadruple_byte()
117+
{
118+
uint[] integers = [3503876];
119+
uint[] expected = [129, 213, 238, 4];
120+
Assert.Equal(expected, VariableLengthQuantity.Encode(integers));
121+
}
122+
91123
[Fact(Skip = "Remove this Skip property to run this test")]
92124
public void Encode_a_series_of_integers_producing_a_series_of_bytes_largest_quadruple_byte()
93125
{
@@ -112,6 +144,14 @@ public void Encode_a_series_of_integers_producing_a_series_of_bytes_arbitrary_qu
112144
Assert.Equal(expected, VariableLengthQuantity.Encode(integers));
113145
}
114146

147+
[Fact(Skip = "Remove this Skip property to run this test")]
148+
public void Encode_a_series_of_integers_producing_a_series_of_bytes_asymmetric_quintuple_byte()
149+
{
150+
uint[] integers = [2254790917];
151+
uint[] expected = [136, 179, 149, 194, 5];
152+
Assert.Equal(expected, VariableLengthQuantity.Encode(integers));
153+
}
154+
115155
[Fact(Skip = "Remove this Skip property to run this test")]
116156
public void Encode_a_series_of_integers_producing_a_series_of_bytes_maximum_32_bit_integer_input()
117157
{

0 commit comments

Comments
 (0)