Skip to content

Commit f422357

Browse files
authored
Sync simple linked lists (#295)
This updates the exercise to sync the canonical test data. Note, this change also attempts to maintain support for solutions written before the canonical data was added. The test differs from the canonical data in the following ways: - len property is used in place of a dedicated count() function - to_array is used in place of to_list - to_array is used for validation in the reverse tests
1 parent 95d8cb1 commit f422357

2 files changed

Lines changed: 333 additions & 31 deletions

File tree

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
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.
11+
12+
[962d998c-c203-41e2-8fbd-85a7b98b79b9]
13+
description = "count -> Empty list has length of zero"
14+
comment = "In implementations, counts use the len field to support solutions written before this canonical data was added"
15+
16+
[9760262e-d7e4-4639-9840-87e2e2fbb115]
17+
description = "count -> Singleton list has length of one"
18+
19+
[d9955c90-637c-441b-b41d-8cfb48e924a8]
20+
description = "count -> Non-empty list has correct length"
21+
22+
[0c3966db-58f9-4632-b94c-8ea13e54c2c8]
23+
description = "pop -> Pop from empty list is an error"
24+
25+
[a4f9d2e1-7425-49ef-9ee8-6c0cb3407cf0]
26+
description = "pop -> Can pop from singleton list"
27+
28+
[6dcbb2c9-d98a-47bc-a010-9c19703d3ea2]
29+
description = "pop -> Can pop from non-empty list"
30+
31+
[e83aade9-f030-4096-aaf0-f9dc6491e6cf]
32+
description = "pop -> Can pop multiple items"
33+
34+
[5c46bcf2-c0a9-4654-ae17-f3192436fcf1]
35+
description = "pop -> Pop updates the count"
36+
37+
[70d747a1-2e84-4ebc-bc3f-dcbee6a05f6b]
38+
description = "push -> Can push to an empty list"
39+
include = false
40+
41+
[f3197f0a-1fea-45a5-939f-4a5ea60387ec]
42+
description = "push -> Can push to an empty list"
43+
reimplements = "70d747a1-2e84-4ebc-bc3f-dcbee6a05f6b"
44+
45+
[391e332e-1f91-4033-b1e0-0e0c17812fa7]
46+
description = "push -> Can push to a non-empty list"
47+
48+
[ed4b0e01-3bbd-4895-af25-152b5914b3da]
49+
description = "push -> Push updates count"
50+
51+
[41666790-b932-4e5a-b323-e848a83d12d5]
52+
description = "push -> Push and pop"
53+
54+
[930a4a5c-76f6-47ec-9be3-4e70993173a1]
55+
description = "peek -> Peek on empty list is an error"
56+
57+
[43255a50-d919-4e81-afce-e4a271eaedbd]
58+
description = "peek -> Can peek on singleton list"
59+
60+
[48353020-e25d-4621-a854-e35fb1e15fa7]
61+
description = "peek -> Can peek on non-empty list"
62+
63+
[96fcead9-a713-46c2-8005-3f246c873851]
64+
description = "peek -> Peek does not change the count"
65+
66+
[7576ed05-7ff7-4b84-8efb-d34d62c110f5]
67+
description = "peek -> Can peek after a pop and push"
68+
69+
[b97d00b6-2fab-435d-ae74-3233dcc13698]
70+
description = "toList LIFO -> Empty linked list to list is empty"
71+
include = false
72+
73+
[eedeb95f-b5cf-431d-8ad6-5854ba6b251c]
74+
description = "toList LIFO -> To list with multiple values"
75+
include = false
76+
77+
[838678de-eaf3-4c14-b34e-7e35b6d851e8]
78+
description = "toList LIFO -> To list after a pop"
79+
include = false
80+
81+
[03fc83a5-48a8-470b-a2d2-a286c5e8365f]
82+
description = "toList FIFO -> Empty linked list to list is empty"
83+
comment = "to_array is used in place of to_list to maintain support for solutions prior to the canonical data"
84+
85+
[1282484e-a58c-426a-972e-90746bda61fc]
86+
description = "toList FIFO -> To list with multiple values"
87+
88+
[05ca3109-1249-4c0c-a567-a3b2f8352a7c]
89+
description = "toList FIFO -> To list after a pop"
90+
91+
[5e6c1a3d-e34b-46d3-be59-3f132a820ed5]
92+
description = "reverse -> Reversed empty list has same values"
93+
comment = "Implementation uses to_array to maintain support for solutions prior to the canonical data"
94+
95+
[93c87ed3-862a-474f-820b-ba3fd6b6daf6]
96+
description = "reverse -> Reversed singleton list is same list"
97+
98+
[92851ebe-9f52-4406-b92e-0718c441a2ab]
99+
description = "reverse -> Reversed non-empty list is reversed"
100+
include = false
101+
102+
[1210eeda-b23f-4790-930c-7ac6d0c8e723]
103+
description = "reverse -> Reversed non-empty list is reversed"
104+
reimplements = "92851ebe-9f52-4406-b92e-0718c441a2ab"
105+
106+
[9b53af96-7494-4cfa-9b77-b7366fed5c4c]
107+
description = "reverse -> Double reverse"

0 commit comments

Comments
 (0)