Skip to content

Commit

Permalink
Merge pull request #510 from rcode5/trinary-add-canonical-data
Browse files Browse the repository at this point in the history
trinary: Add canonical-data.json
  • Loading branch information
Katrina Owen authored Jan 28, 2017
2 parents d0f8912 + 5d332d5 commit 851013b
Showing 1 changed file with 62 additions and 0 deletions.
62 changes: 62 additions & 0 deletions exercises/trinary/canonical-data.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{
"to_decimal": {
"description": "returns the decimal representation of the input trinary value",
"cases": [
{
"description": "trinary 1 is decimal 1",
"input": 1,
"expected": 1
},
{
"description": "trinary 2 is decimal 2",
"input": 2,
"expected": 2
},
{
"description": "trinary 10 is decimal 3",
"input": 10,
"expected": 3
},
{
"description": "trinary 11 is decimal 4",
"input": 11,
"expected": 4
},
{
"description": "trinary 100 is decimal 9",
"input": 100,
"expected": 9
},
{
"description": "trinary 112 is decimal 14",
"input": 112,
"expected": 14
},
{
"description": "trinary 222 is decimal 26",
"input": 222,
"expected": 26
},
{
"description": "trinary 1122000120 is decimal 32091",
"input": 1122000120,
"expected": 32091
},
{
"description": "invalid trinary digits returns 0",
"input": "1234",
"expected": 0
},
{
"description": "invalid word as input returns 0",
"input": "carrot",
"expected": 0
},
{
"description": "invalid numbers with letters as input returns 0",
"input": "0a1b2c",
"expected": 0
}
]
}
}

0 comments on commit 851013b

Please sign in to comment.