Arcaster42 / rhymus

An open-source rhyming game project designed for new developers and first-time contributors.
https://rhymus-one.vercel.app
MIT License
12 stars 15 forks source link

Rhyming Test of Puzzles #40

Closed josephting closed 4 years ago

josephting commented 5 years ago

I tried to add test cases to test if all the puzzles' words and answers are rhyming using rhyme-plus.

There were some puzzles where the package tested as negatives (doesn't rhyme) and I wonder if it's something we can fix in the puzzle or the package I'm using here is no good.

You can see the test code in rhyme-test branch of my fork.

Here are all the combinations that failed.

Puzzle ID Word Answer
2 a sheep asleep
21 squish wish
36 kips chips
43 utensil pencil
44 hadniness happiness

Below is raw test result.

➜ yarn test
yarn run v1.19.1
$ mocha ./tests/spec.js

  Rhymus Test Suite
    Puzzles Tests
      ✓ should exists
      ✓ should have required properties
      ✓ should have properties with the correct types
      Words and answers rhyme
        ✓ 1: log & dog should rhyme (736ms)
        1) 2: a sheep & asleep should rhyme
        ✓ 3: stopping & shopping should rhyme (392ms)
        ✓ 4: set & pet should rhyme (383ms)
        ✓ 5: poke & coke should rhyme (376ms)
        ✓ 6: fall & call should rhyme (459ms)
        ✓ 7: hat & cat should rhyme (376ms)
        ✓ 8: space & race should rhyme (418ms)
        ✓ 9: ten & pen should rhyme (374ms)
        ✓ 10: star & car should rhyme (459ms)
        ✓ 11: doom & room should rhyme (370ms)
        ✓ 12: sawing & drawing should rhyme (421ms)
        ✓ 13: rock & chalk should rhyme (375ms)
        ✓ 14: flap & map should rhyme (452ms)
        ✓ 15: goat & moat should rhyme (375ms)
        ✓ 16: save & cave should rhyme (417ms)
        ✓ 17: look & hook should rhyme (375ms)
        ✓ 18: quake & cake should rhyme (426ms)
        ✓ 19: glove & dove should rhyme (375ms)
        ✓ 20: coat & boat should rhyme (375ms)
        2) 21: squish & wish should rhyme
        ✓ 22: scorns & thorns should rhyme (369ms)
        ✓ 23: guest & quest should rhyme (413ms)
        ✓ 24: beagles & eagles should rhyme (417ms)
        ✓ 25: tower & flower should rhyme (389ms)
        ✓ 26: cart & heart should rhyme (402ms)
        ✓ 27: gun & sun should rhyme (371ms)
        ✓ 28: rope & soap should rhyme (376ms)
        ✓ 29: press & dress should rhyme (423ms)
        ✓ 30: key & tea should rhyme (368ms)
        ✓ 31: throttle & bottle should rhyme (428ms)
        ✓ 32: fry & sky should rhyme (368ms)
        ✓ 33: lace & pace should rhyme (421ms)
        ✓ 34: sink & think should rhyme (372ms)
        ✓ 35: spree & tree should rhyme (426ms)
        3) 36: kips & chips should rhyme
        ✓ 37: lumber & number should rhyme (380ms)
        ✓ 38: clout & doubt should rhyme (423ms)
        ✓ 39: layer & player should rhyme (367ms)
        ✓ 40: cone & phone should rhyme (467ms)
        ✓ 41: tall & mall should rhyme (378ms)
        ✓ 42: strive & drive should rhyme (370ms)
        4) 43: utensil & pencil should rhyme
        5) 44: hadniness & happiness should rhyme
        ✓ 45: cards & yards should rhyme (371ms)
    Game Logic Tests
      ✓ should be tested in spec.html in browser

  44 passing (18s)
  5 failing

  1) Rhymus Test Suite
       Puzzles Tests
         Words and answers rhyme
           2: a sheep & asleep should rhyme:

      Uncaught AssertionError: expected false to be true
      + expected - actual

      -false
      +true

      at /Users/josephting/dev/workbench/josephting/rhymus/tests/spec.js:37:66
      at ReadStream.<anonymous> (node_modules/rhyme-plus/index.js:115:9)
      at endReadableNT (_stream_readable.js:1183:12)
      at processTicksAndRejections (internal/process/task_queues.js:80:21)

  2) Rhymus Test Suite
       Puzzles Tests
         Words and answers rhyme
           21: squish & wish should rhyme:

      Uncaught AssertionError: expected false to be true
      + expected - actual

      -false
      +true

      at /Users/josephting/dev/workbench/josephting/rhymus/tests/spec.js:37:66
      at ReadStream.<anonymous> (node_modules/rhyme-plus/index.js:115:9)
      at endReadableNT (_stream_readable.js:1183:12)
      at processTicksAndRejections (internal/process/task_queues.js:80:21)

  3) Rhymus Test Suite
       Puzzles Tests
         Words and answers rhyme
           36: kips & chips should rhyme:

      Uncaught AssertionError: expected false to be true
      + expected - actual

      -false
      +true

      at /Users/josephting/dev/workbench/josephting/rhymus/tests/spec.js:37:66
      at ReadStream.<anonymous> (node_modules/rhyme-plus/index.js:115:9)
      at endReadableNT (_stream_readable.js:1183:12)
      at processTicksAndRejections (internal/process/task_queues.js:80:21)

  4) Rhymus Test Suite
       Puzzles Tests
         Words and answers rhyme
           43: utensil & pencil should rhyme:

      Uncaught AssertionError: expected false to be true
      + expected - actual

      -false
      +true

      at /Users/josephting/dev/workbench/josephting/rhymus/tests/spec.js:37:66
      at ReadStream.<anonymous> (node_modules/rhyme-plus/index.js:115:9)
      at endReadableNT (_stream_readable.js:1183:12)
      at processTicksAndRejections (internal/process/task_queues.js:80:21)

  5) Rhymus Test Suite
       Puzzles Tests
         Words and answers rhyme
           44: hadniness & happiness should rhyme:

      Uncaught AssertionError: expected false to be true
      + expected - actual

      -false
      +true

      at /Users/josephting/dev/workbench/josephting/rhymus/tests/spec.js:37:66
      at ReadStream.<anonymous> (node_modules/rhyme-plus/index.js:115:9)
      at endReadableNT (_stream_readable.js:1183:12)
      at processTicksAndRejections (internal/process/task_queues.js:80:21)

error Command failed with exit code 5.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Arcaster42 commented 5 years ago

That's a pretty cool test. So a sheep and asleep I'd say rhyme, but it is reliant upon the pronunciation. I'd say same goes for others except for the misspelling that the test caught. If you'd like to rewrite the puzzles to be similar but fit into the test, I'm definitely ok with that. This is a great test to use in our CI.

Arcaster42 commented 4 years ago

Going to merge in the tester shortly.