Files
kiss-tools/src/kiss_tools/Main.kiss
2022-08-05 18:57:22 +00:00

13 lines
568 B
Plaintext

// Test FuzzyJson
(load "FuzzyJson.kiss")
(loadFuzzyJson "dogs" "test/fuzzy.json")
(loadFuzzyJson "dogs" "test/fuzzy2.json")
(assert (= "is a very good dog" (getFuzzyJson "dogs" "Albort")))
// takeFuzzyJson removes the match to make following fuzzyJson retrievals save time:
(assert (= "is a very good dog" (takeFuzzyJson "dogs" "Albort")))
// No good match will cause crash at compile time:
(assertThrowsAtCompileTime (getFuzzyJson "dogs" "Albort"))
// duplicate definitions throw an error at compile time:
(assertThrowsAtCompileTime (getFuzzyJson "dogs" "Rangie"))