Skip to content

Commit

Permalink
Refactoring of test cases with improved descriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelritzschke committed Feb 2, 2020
1 parent 4cd0719 commit f18d301
Showing 1 changed file with 88 additions and 57 deletions.
145 changes: 88 additions & 57 deletions exercises/levenshtein-distance/canonical-data.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,63 +3,94 @@
"version": "1.0.0",
"cases": [
{
"description": "Calculate Levenshtein distance",
"cases": [
{
"description": "mine_to_times",
"property": "distance",
"input": {
"phrase": "mine",
"phrase": "times"
},
"expected": "3"
},
{
"description": "_to_abcd",
"property": "distance",
"input": {
"phrase": "",
"phrase": "abcd"
},
"expected": "4"
},
{
"description": "12345_to_",
"property": "distance",
"input": {
"phrase": "12345",
"phrase": ""
},
"expected": "5"
},
{
"description": "lifo_to_fifo",
"property": "distance",
"input": {
"phrase": "lifo",
"phrase": "fifo"
},
"expected": "1"
},
{
"description": "Hello-World!_to_hello-world",
"property": "distance",
"input": {
"phrase": "Hello World!",
"phrase": "hello world"
},
"expected": "3"
},
{
"description": "oxygenO2_to_carbondioxideCO2",
"property": "distance",
"input": {
"phrase": "oxygenO2",
"phrase": "carbondioxideCO2"
},
"expected": "11"
}
]
"description": "empty strings",
"property": "distance",
"input": {
"from": "",
"to": ""
},
"expected": 0
},
{
"description": "identical strings",
"property": "distance",
"input": {
"from": "abcdefghij",
"to": "abcdefghij"
},
"expected": 0
},
{
"description": "only insertions",
"property": "distance",
"input": {
"from": "",
"to": "abcd"
},
"expected": 4
},
{
"description": "only deletions",
"property": "distance",
"input": {
"from": "abcd",
"to": ""
},
"expected": 4
},
{
"description": "only substitution",
"property": "distance",
"input": {
"from": "lifo",
"to": "fifo"
},
"expected": 1
},
{
"description": "substitution and insertion",
"property": "distance",
"input": {
"from": "mine",
"to": "times"
},
"expected": 3
},
{
"description": "substitution and deletion",
"property": "distance",
"input": {
"from": "times",
"to": "mine"
},
"expected": 3
},
{
"description": "with numbers",
"property": "distance",
"input": {
"from": "abc123",
"to": "abd2234"
},
"expected": 3
},
{
"description": "with special characters",
"property": "distance",
"input": {
"from": "hello world!",
"to": "helloworld"
},
"expected": 2
},
{
"description": "with capital letters",
"property": "distance",
"input": {
"from": "Oxygen O2",
"to": "Carbondioxide CO2"
},
"expected": 13
}
]
}

0 comments on commit f18d301

Please sign in to comment.