-
Notifications
You must be signed in to change notification settings - Fork 13
testing.coffeescript
Dylon Edwards edited this page Jun 19, 2015
·
6 revisions
Home > Testing > CoffeeScript / JavaScript
Be sure to check out the instructions regarding installing the
library. Then, run the unit tests via cake test
:
% cake test
builder
✔ Property Tests - dictionary should be readable and writable
✔ Property Tests - algorithm should be readable and writable
✔ Property Tests - sort_candidates should be readable and writable
✔ Property Tests - case_insensitive_sort should be readable and writable
✔ Property Tests - include_distance should be readable and writable
✔ Property Tests - maximum_candidates should be readable and writable
✔ Property Tests - custom_comparator should be readable and writable
✔ Property Tests - custom_transform should be readable and writable
✔ Property Tests - default_edit_distance should be readable and writable
✔ Default edit distance should be overwritable
✔ Builder#transducer should return an instance of Transducer for every combination of options
✔ Verify there are only true-positives and true-negatives
distance
✔ Levenshtein Distance - The distance should conform to Equal Self-Similarity
✔ Levenshtein Distance - The distance should conform to Minimality
✔ Levenshtein Distance - The distance should conform to Symmetry
✔ Levenshtein Distance - The distance should conform to the Triangle Inequality
✔ Levenshtein Distance - The distance between a term and itself should be 0
✔ Levenshtein Distance - An insertion should incur a penalty of 1 unit
✔ Levenshtein Distance - A deletion should incur a penalty of 1 unit
✔ Levenshtein Distance - A substitution should incur a penalty of 1 unit
✔ Levenshtein Distance - A transposition should incur a penalty of 2 unit(s)
✔ Levenshtein Distance - A merge should incur a penalty of 2 unit(s)
✔ Levenshtein Distance - A split should incur a penalty of 2 unit(s)
✔ Levenshtein Distance Extended with Transposition - The distance should conform to Equal Self-Similarity
✔ Levenshtein Distance Extended with Transposition - The distance should conform to Minimality
✔ Levenshtein Distance Extended with Transposition - The distance should conform to Symmetry
✔ Levenshtein Distance Extended with Transposition - The distance should conform to the Triangle Inequality
✔ Levenshtein Distance Extended with Transposition - The distance between a term and itself should be 0
✔ Levenshtein Distance Extended with Transposition - An insertion should incur a penalty of 1 unit
✔ Levenshtein Distance Extended with Transposition - A deletion should incur a penalty of 1 unit
✔ Levenshtein Distance Extended with Transposition - A substitution should incur a penalty of 1 unit
✔ Levenshtein Distance Extended with Transposition - A transposition should incur a penalty of 1 unit(s)
✔ Levenshtein Distance Extended with Transposition - A merge should incur a penalty of 2 unit(s)
✔ Levenshtein Distance Extended with Transposition - A split should incur a penalty of 2 unit(s)
✔ Levenshtein Distance Extended with Merge and Split - The distance should conform to Equal Self-Similarity
✔ Levenshtein Distance Extended with Merge and Split - The distance should conform to Minimality
✔ Levenshtein Distance Extended with Merge and Split - The distance should conform to Symmetry
✔ Levenshtein Distance Extended with Merge and Split - The distance should conform to the Triangle Inequality
✔ Levenshtein Distance Extended with Merge and Split - The distance between a term and itself should be 0
✔ Levenshtein Distance Extended with Merge and Split - An insertion should incur a penalty of 1 unit
✔ Levenshtein Distance Extended with Merge and Split - A deletion should incur a penalty of 1 unit
✔ Levenshtein Distance Extended with Merge and Split - A substitution should incur a penalty of 1 unit
✔ Levenshtein Distance Extended with Merge and Split - A transposition should incur a penalty of 2 unit(s)
✔ Levenshtein Distance Extended with Merge and Split - A merge should incur a penalty of 1 unit(s)
✔ Levenshtein Distance Extended with Merge and Split - A split should incur a penalty of 1 unit(s)
dawg
✔ Instantiating a DAWG without a list should throw an error
✔ An empty DAWG should not accept anything
✔ A DAWG should accept all and only its complete terms
max-heap
✔ Instantiating a heap improperly should throw an error
✔ A max-heap on 0 elements should return null on *.peek() and *.pop()
✔ A max-heap with 1 element should return that element on *.peek() and *.pop(), and after *.pop() should return null.
✔ Every permutation of 0..6 should be dequeued in the same order
permutations
✔ There should be no permutations on an empty list
✔ The only permutation on a singleton list should be the same list
✔ There should be 2-factorial, distinct permutations on a pair
✔ There should be 3-factorial, distinct permutations on a triple
✔ There should be 4-factorial, distinct permutations on a quadruple
✔ There should be 5-factorial, distinct permutations on a 5-tuple
OK: 247761 assertions (8190ms)
After verifying that all the tests pass, you may wish to use the library.
liblevenshtein is maintained by @dylon