Skip to content

Remove extra comments from tests #34

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 3, 2024
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
22 changes: 0 additions & 22 deletions exercises/practice/circular-buffer/circular-buffer-test.ys
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,6 @@ require ys::taptest: :all

use: circular-buffer

# In general, these circular buffers are expected to be stateful,
# and each language will operate on them differently.
# Tests tend to perform a series of operations, some of which expect a certain result.
# As such, this common test suite can only say in abstract terms what should be done.
#
# Tests will contain a number of operations. The operation will be specified in the `operation` key.
# Based on the operation, other keys may be present.
# read: Reading from the buffer should succeed if and only if `should_succeed` is true.
# If it should succeed, it should produce the item at `expected`.
# If it should fail, `expected` will not be present.
# write: Writing the item located at `item` should succeed if and only if `should_succeed` is true.
# overwrite: Write the item located at `item` into the buffer, replacing the oldest item if necessary.
# clear: Clear the buffer.
#
# Failure of either `read` or `write` may be indicated in a manner appropriate for your language:
# Raising an exception, returning (int, error), returning Option<int>, etc.
#
# Finally, note that all values are integers.
# If your language contains generics, you may consider allowing buffers to contain other types.
# Tests for that are not included here.


test::
- name: Reading empty buffer should fail
code: run(1 [{"operation" "read", "should_succeed" false}])
Expand Down
3 changes: 0 additions & 3 deletions exercises/practice/grains/.meta/grains-test.ys
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ require ys::taptest: :all

use: grains

# The final tests of square test error conditions
# In these cases you should expect an error as is idiomatic for your language

test::
- name: Grains on square 1
code: square(1)
Expand Down
3 changes: 0 additions & 3 deletions exercises/practice/grains/grains-test.ys
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ require ys::taptest: :all

use: grains

# The final tests of square test error conditions
# In these cases you should expect an error as is idiomatic for your language

test::
- name: Grains on square 1
code: square(1)
Expand Down
32 changes: 1 addition & 31 deletions exercises/practice/hamming/.meta/hamming-test.ys
Original file line number Diff line number Diff line change
Expand Up @@ -30,26 +30,12 @@ test::
want: 9
uuid: cd2273a5-c576-46c8-a52b-dee251c3e6e5

- name: Disallow first strand longer
code: distance("AATG" "AAA")
what: error
# want: left and right strands must be of equal length
want: strands must be of equal length
uuid: 919f8ef0-b767-4d1b-8516-6379d07fcb28

- name: Disallow first strand longer
code: distance("AATG" "AAA")
what: error
want: strands must be of equal length
uuid: b9228bb1-465f-4141-b40f-1f99812de5a8

- name: Disallow second strand longer
code: distance("ATA" "AGTG")
what: error
# want: left and right strands must be of equal length
want: strands must be of equal length
uuid: 8a2d4ed0-ead5-4fdd-924d-27c4cf56e60e

- name: Disallow second strand longer
code: distance("ATA" "AGTG")
what: error
Expand All @@ -59,14 +45,6 @@ test::
- name: Disallow left empty strand
code: distance("" "G")
what: error
# want: left strand must not be empty
want: strands must be of equal length
uuid: 5dce058b-28d4-4ca7-aa64-adfe4e17784c

- name: Disallow left empty strand
code: distance("" "G")
what: error
# want: left and right strands must be of equal length
want: strands must be of equal length
uuid: db92e77e-7c72-499d-8fe6-9354d2bfd504

Expand All @@ -79,14 +57,6 @@ test::
- name: Disallow right empty strand
code: distance("G" "")
what: error
# want: right strand must not be empty
want: strands must be of equal length
uuid: 38826d4b-16fb-4639-ac3e-ba027dec8b5f

- name: Disallow right empty strand
code: distance("G" "")
what: error
# want: left and right strands must be of equal length
want: strands must be of equal length
uuid: 920cd6e3-18f4-4143-b6b8-74270bb8f8a3

Expand All @@ -96,4 +66,4 @@ test::
want: strands must be of equal length
uuid: 9ab9262f-3521-4191-81f5-0ed184a5aa89

done: 15
done: 11
28 changes: 1 addition & 27 deletions exercises/practice/hamming/hamming-test.ys
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,6 @@ test::
- name: Disallow first strand longer
code: distance("AATG" "AAA")
what: error
# want: left and right strands must be of equal length
want: strands must be of equal length

- name: Disallow first strand longer
code: distance("AATG" "AAA")
what: error
want: strands must be of equal length

- name: Disallow second strand longer
code: distance("ATA" "AGTG")
what: error
# want: left and right strands must be of equal length
want: strands must be of equal length

- name: Disallow second strand longer
Expand All @@ -50,13 +38,6 @@ test::
- name: Disallow left empty strand
code: distance("" "G")
what: error
# want: left strand must not be empty
want: strands must be of equal length

- name: Disallow left empty strand
code: distance("" "G")
what: error
# want: left and right strands must be of equal length
want: strands must be of equal length

- name: Disallow empty first strand
Expand All @@ -67,18 +48,11 @@ test::
- name: Disallow right empty strand
code: distance("G" "")
what: error
# want: right strand must not be empty
want: strands must be of equal length

- name: Disallow right empty strand
code: distance("G" "")
what: error
# want: left and right strands must be of equal length
want: strands must be of equal length

- name: Disallow empty second strand
code: distance("G" "")
what: error
want: strands must be of equal length

done: 15
done: 11
Original file line number Diff line number Diff line change
Expand Up @@ -78,17 +78,10 @@ test::
want: digits input must only contain digits
uuid: 7a38f2d6-3c35-45f6-8d6f-12e6e32d4d74

- name: Rejects negative span
code: largest-product("12345" -1)
what: error
# want: span must be greater than zero
want: span must not be negative
uuid: 5fe3c0e5-a945-49f2-b584-f0814b4dd1ef

- name: Rejects negative span
code: largest-product("12345" -1)
what: error
want: span must not be negative
uuid: c859f34a-9bfe-4897-9c2f-6d7f8598e7f0

done: 16
done: 15
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,6 @@ test::
- name: Rejects negative span
code: largest-product("12345" -1)
what: error
# want: span must be greater than zero
want: span must not be negative

- name: Rejects negative span
code: largest-product("12345" -1)
what: error
want: span must not be negative

done: 16
done: 15
4 changes: 0 additions & 4 deletions exercises/practice/list-ops/.meta/list-ops-test.ys
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@ require ys::taptest: :all

use: list-ops

# Though there are no specifications here for dealing with large lists,
# implementers may add tests for handling large lists to ensure that the
# solutions have thought about performance concerns.

test::
- name: Empty lists
code: append([] [])
Expand Down
4 changes: 0 additions & 4 deletions exercises/practice/list-ops/list-ops-test.ys
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@ require ys::taptest: :all

use: list-ops

# Though there are no specifications here for dealing with large lists,
# implementers may add tests for handling large lists to ensure that the
# solutions have thought about performance concerns.

test::
- name: Empty lists
code: append([] [])
Expand Down
6 changes: 2 additions & 4 deletions exercises/practice/nth-prime/nth-prime-test.ys
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ test::
want: 13

- name: Big prime
# code: prime(10001) # Takes 200 ms
# want: 104743
code: prime(1001)
want: 7927
code: prime(10001)
want: 104743

done: 4
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ require ys::taptest: :all

use: pascals-triangle

# Expectations are represented here as an array of arrays.
# How you represent this idiomatically in your language is up to you.

test::
- name: Zero rows
code: rows(0)
Expand Down
3 changes: 0 additions & 3 deletions exercises/practice/pascals-triangle/pascals-triangle-test.ys
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ require ys::taptest: :all

use: pascals-triangle

# Expectations are represented here as an array of arrays.
# How you represent this idiomatically in your language is up to you.

test::
- name: Zero rows
code: rows(0)
Expand Down
5 changes: 1 addition & 4 deletions exercises/practice/perfect-numbers/perfect-numbers-test.ys
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ test::
- name: Large perfect number is classified correctly
code: classify(33550336)
want: perfect
SKIP: true # SLOW

- name: Smallest abundant number is classified correctly
code: classify(12)
Expand All @@ -29,7 +28,6 @@ test::
- name: Large abundant number is classified correctly
code: classify(33550335)
want: abundant
SKIP: true # SLOW

- name: Smallest prime deficient number is classified correctly
code: classify(2)
Expand All @@ -46,7 +44,6 @@ test::
- name: Large deficient number is classified correctly
code: classify(33550337)
want: deficient
SKIP: true # SLOW

- name: Edge case (no factors other than itself) is classified correctly
code: classify(1)
Expand All @@ -62,4 +59,4 @@ test::
what: error
want: Classification is only possible for positive integers.

done: 10 # 13
done: 13