@axtens @softmoth Kindly have a look: Create the Sieve of Eratosthenes exercise. by glennj · Pull Request #101 · exercism/8th · GitHub
Talking about test-word names:
current | perhaps … | … or |
---|---|---|
test_eq | test-num-eq | is-eq-num |
test_eqs | test-str-eq | is-eq-str |
test_true | test-true | is-true or is |
test_false | test-false | is-false or isnt |
test_null | test-null | is-null |
test_eqa | test-arr-of-str-eq | is-arr-of-str-eq |
test_array_eq_num | test-arr-of-num-eq | is-arr-of-num |
test_eqa2 | test-arr-of-arr-of-num-eq | is-arr-of-arr-of-num-eq |
test_map_eq | test-map-num-eq | is-map-of-num-eq |
test_map_neq | test-map-num-neq | is-map-of-num-neq |
@axtens @softmoth Thoughts? Bruce already merged the PR, so I have to follow up syncing the test-words files. Now’s a good time to do this housekeeping.
I don’t have a firm commitment to a particular naming schema. Whatever is chosen, it needs to be consistent. When I’m doing 8th exercises myself, I’m not as concerned about the test word naming as much as passing the tests. Having said that, the “is-” prefix doesn’t reinforce the fact that these are words defined for testing whereas “test-” does.
I like your “perhaps…” suggestions. We also have flexibility with 8th because words can have almost any characters in them. We could rely on namespaces and punctuation, so something like test-n=
instead of test-num-eq
. And test-a[a[n]]=
instead of test-arr-of-arr-of-num-eq
. I don’t know if that’s utilizing a great feature of 8th well, or being way too clever and cryptic for our own good.
Also, I didn’t mention it earlier, but it’s great to have bin/add-exercise
!
OK, I’ll make a PR and we can discuss it from there…
I had a brainstorm: use a namespace.
If test-words introduces a test
namespace, then:
current | suggest |
---|---|
tests |
test:begin |
end-of-tests |
test:end |
SKIP-REST-OF-TESTS |
test:skip-remaining |
test_eq |
test:n= |
test_eqs |
test:s= |
test_true |
test:true? |
test_false |
test:false? |
test_null |
test:null? |
test_eqa |
test:a<s>= |
test_array_eq_num |
test:a<n>= |
test_eqa2 |
test:a<a<n>>= |
test_map_eq |
test:m<n>= |
test_map_neq |
test:m<n>!= |
I’m wondering if these are too opaque for new usrs…
I created a draft PR for discussion: