Skip to content
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

sync: Does not produce a tests.toml file for grains #39

Closed
ee7 opened this issue Oct 12, 2020 · 2 comments · Fixed by #42
Closed

sync: Does not produce a tests.toml file for grains #39

ee7 opened this issue Oct 12, 2020 · 2 comments · Fixed by #42
Labels
cmd: sync kind: bug User-facing incorrect behavior

Comments

@ee7
Copy link
Member

ee7 commented Oct 12, 2020

Example

On a track that contains the grains exercise, but lacks a exercises/grains/.meta/tests.toml file, run:

canonical_data_syncer

Current behaviour

The program does not create a tests.toml file for grains, but we see

All exercises are synced!

Expected behaviour

The program should create a tests.toml file for grains.

The expected contents are:

[canonical-tests]

# 1
"9fbde8de-36b2-49de-baf2-cd42d6f28405" = true

# 2
"ee1f30c2-01d8-4298-b25d-c677331b5e6d" = true

# 3
"10f45584-2fc3-4875-8ec6-666065d1163b" = true

# 4
"a7cbe01b-36f4-4601-b053-c5f6ae055170" = true

# 16
"c50acc89-8535-44e4-918f-b848ad2817d4" = true

# 32
"acd81b46-c2ad-4951-b848-80d15ed5a04f" = true

# 64
"c73b470a-5efb-4d53-9ac6-c5f6487f227b" = true

# square 0 raises an exception
"1d47d832-3e85-4974-9466-5bd35af484e3" = true

# negative square raises an exception
"61974483-eeb2-465e-be54-ca5dde366453" = true

# square greater than 64 raises an exception
"a95e4374-f32c-45a7-a10d-ffec475c012f" = true

# returns the total number of grains on the board
"6eb07385-3659-4b45-a6be-9dc474222750" = true

Discussion

The cause is here:
https://github.com/exercism/canonical-data-syncer/blob/6e162f70b6944e87ffc2ae60314c38f06459541d/src/probspecs.nim#L80-L84

I remember running into this problem myself. It's because grains contains two test cases with large numbers (here and here).

The first number is one larger than we can store in a 64-bit signed integer, so it causes an error (and the second number is the maximum that can be stored in a 64-bit unsigned integer).

@ErikSchierboom
Copy link
Member

Ah yes, that is correct. Should have remembered to fix that, doh! I've actually created an issue on the Nim repo for this.

What we should (pending a fix in Nim itself) is probably to just do a text-replace to "correct" the value to one that Nim can handle (maybe use a float?).

@ErikSchierboom
Copy link
Member

When this is fixed, a PR should be sent to the various tracks to add the missing tests.toml file for the grains exercise.

ee7 added a commit to ee7/exercism-configlet that referenced this issue Oct 13, 2020
Previously, the tool did not create a `tests.toml` file for `grains`.

Fixes: exercism#39
ee7 added a commit to ee7/exercism-configlet that referenced this issue Oct 13, 2020
Previously, the tool did not create a `tests.toml` file for `grains`.

Fixes: exercism#39
ErikSchierboom pushed a commit that referenced this issue Oct 13, 2020
Previously, the tool did not create a `tests.toml` file for `grains`.

Fixes: #39
ee7 added a commit to ee7/exercism-configlet that referenced this issue Jan 21, 2021
Previously, the tool did not create a `tests.toml` file for `grains`.

Fixes: exercism#39
@ee7 ee7 added cmd: sync kind: bug User-facing incorrect behavior labels May 10, 2021
@ee7 ee7 changed the title Sync: Program does not produce a toml file for grains sync: Does not produce a tests.toml file for grains May 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cmd: sync kind: bug User-facing incorrect behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants