question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Tests for Zipper are far from sufficient

See original GitHub issue

Reference: https://exercism.io/mentor/solutions/962ebabf19e848e5bceed0533f1898ad#discussion-post-605355

We should add a test similar to:

test('traversal returns a new Zipper object', () => {
    expect(zipper.value()).toEqual(1);
    let left = zipper.left();
    expect(zipper.value()).toEqual(1);
    expect(left.value()).toEqual(2);
  })

This seems to be a pretty key thing to not test for.

I don’t actually think the students exact implementation is super critical here. What they did was implement a single object with a “cursor” that kept track of where it was in the tree and acted accordingly. So that calling left or right would merely update the cursor position…

Which 100% works since the current tests never require that a new object be generated.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:12 (12 by maintainers)

github_iconTop GitHub Comments

1reaction
joshgoebelcommented, Mar 7, 2020

Oh I forgot we had those sample solutions. 😃

Oh, setting is suppose to make new zippers too? Yeah, even my own solution is doing this way wrong… starting to sound like a uber functional exercise. 😃

They all have their own “pointers”, but they all point to the same nodes. That is correct.

When I hear pointer I think of the object property, not the object itself… Ie Zipper#focusNode is the pointer, since it’s literally pointing at the node… but I see how you’d come to think of the higher level object as doing the same thing, despite it really just holding the pointer.

0reactions
SleeplessBytecommented, Mar 7, 2020

It doesn’t. But for now this is all we can do, because I want to keep following the problem-specifications readme format. I don’t want to have to keep track “which exercises have a special readme” as often we mass re-generate all the readme’s.

In v3 this is fixed! So it’s only a concern for now anyway. 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Standard Test Methods for - Strength Tests for Zippers1
9.1 These test methods cover the determination of the strengths of zipper chains and elements in tensile tests. 9.2 The element pull-off and ......
Read more >
Methods For Evaluating The Physical Performance Of Zippers
The physical performance of zippers can be measured and determined in various ways, dependent upon the types of zippers and the desired ...
Read more >
The "Zipper Test" Shoulder Flexibilty Assessment Demonstration
The " Zipper Test " Shoulder Flexibilty Assessment Demonstration. 17K views 10 years ago. karisabin05. karisabin05. 64 subscribers. Subscribe.
Read more >
Testing Methods / YKK FASTENING PRODUCTS GROUP
Zipper Testing Methods. There are various methods by which to evaluate zipper strength. The basic strength can be determined based on the results...
Read more >
Zipper Reciprocating Tester - QINSUN
Zipper reciprocating tester is used to measure the zipper performance of products with zippers, such as clothes, textiles, auxiliary materials, bags, shoes, etc ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found