Skip to content

Commit

Permalink
Sync Zipper (#2873)
Browse files Browse the repository at this point in the history
This updates the Zipper exercise to sync with the problem specifications.
  • Loading branch information
jagdish-15 authored Nov 19, 2024
1 parent e6063fc commit 9dc8494
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
1 change: 1 addition & 0 deletions exercises/practice/zipper/.meta/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
],
"contributors": [
"FridaTveit",
"jagdish-15",
"jmrunkle",
"lemoncurry",
"msomji",
Expand Down
16 changes: 13 additions & 3 deletions exercises/practice/zipper/.meta/tests.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# This is an auto-generated file. Regular comments will be removed when this
# file is regenerated. Regenerating will not touch any manually added keys,
# so comments can be added in a "comment" key.
# This is an auto-generated file.
#
# Regenerating this file via `configlet sync` will:
# - Recreate every `description` key/value pair
# - Recreate every `reimplements` key/value pair, where they exist in problem-specifications
# - Remove any `include = true` key/value pair (an omitted `include` key implies inclusion)
# - Preserve any other key/value pair
#
# As user-added comments (using the # character) will be removed when this file
# is regenerated, comments can be added via a `comment` key.

[771c652e-0754-4ef0-945c-0675d12ef1f5]
description = "data is retained"
Expand All @@ -20,6 +27,9 @@ description = "traversing up from top"
[b8505f6a-aed4-4c2e-824f-a0ed8570d74b]
description = "left, right, and up"

[b9aa8d54-07b7-4bfd-ab6b-7ff7f35930b6]
description = "test ability to descend multiple levels and return"

[47df1a27-b709-496e-b381-63a03b82ea5f]
description = "set_value"

Expand Down
7 changes: 7 additions & 0 deletions exercises/practice/zipper/src/test/java/ZipperTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,13 @@ public void testLeftRightAndUp() {
assertThat(zipper.left.up.right.up.left.right.getValue()).isEqualTo(3);
}

@Disabled("Remove to run test")
@Test
public void testAbilityToReturnAfterMultipleLevelDescend() {
zipper = binaryTree.getRoot();
assertThat(zipper.left.right.up.up.getValue()).isEqualTo(1);
}

@Disabled("Remove to run test")
@Test
public void testSetValue() {
Expand Down

0 comments on commit 9dc8494

Please sign in to comment.