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

Add more tests to Satellite #2058

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions exercises/satellite/canonical-data.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,42 @@
"expected": {
"error": "traversals must contain unique items"
}
},
{
"uuid": "d232a4e5-622e-4aaa-965e-244ddcdcdb96",
"description": "Complex tree with many integer values",
"property": "treeFromTraversals",
"input": {
"preorder": ["2", "1", "3", "6", "5", "7"],
"inorder": ["1", "2", "3", "5", "6", "7"]
},
"expected": {
"v": "4",
tamireinhorn marked this conversation as resolved.
Show resolved Hide resolved
"l": {
"v": "2",
"l": { "v": "1", "l": {}, "r": {} },
"r": { "v": "3", "l": {}, "r": {} }
},
"r": {
"v": "6",
"l": { "v": "5", "l": {}, "r": {} },
"r": { "v": "7", "l": {}, "r": {} }
}
}
},
{
"uuid": "156a2dd8-a2c7-4a07-b9fe-ab599956d067",
"description": "Simple tree with integer values",
"property": "treeFromTraversals",
"input": {
"preorder": ["2", "1"],
"inorder": ["1", "2"]
},
"expected": {
"v": "2",
"l": "1",
tamireinhorn marked this conversation as resolved.
Show resolved Hide resolved
"r": {}
}
}
]
}