feat: init
This commit is contained in:
53
test/bolt_test.dart
Normal file
53
test/bolt_test.dart
Normal file
@@ -0,0 +1,53 @@
|
||||
import 'package:bolt/bolt.dart';
|
||||
import 'package:test/test.dart';
|
||||
|
||||
void main() {
|
||||
group("Bolt: Check core functions", () {
|
||||
test("Levenshtein", () {
|
||||
// Create cases
|
||||
List<Map<String, dynamic>> tests = [
|
||||
{
|
||||
"name": "Equal strings (case sensitive)",
|
||||
"s": "hello",
|
||||
"t": "hello",
|
||||
"ignoreCase": false,
|
||||
"expected": 0,
|
||||
},
|
||||
{
|
||||
"name": "Equal strings (case insensitive)",
|
||||
"s": "Hello",
|
||||
"t": "hello",
|
||||
"ignoreCase": true,
|
||||
"expected": 0,
|
||||
},
|
||||
{
|
||||
"name": "Different strings (case sensitive)",
|
||||
"s": "kitten",
|
||||
"t": "sitting",
|
||||
"ignoreCase": false,
|
||||
"expected": 3,
|
||||
},
|
||||
{
|
||||
"name": "Different strings (case insensitive)",
|
||||
"s": "Kitten",
|
||||
"t": "Sitting",
|
||||
"ignoreCase": true,
|
||||
"expected": 3,
|
||||
},
|
||||
{
|
||||
"name": "One empty string",
|
||||
"s": "abc",
|
||||
"t": "",
|
||||
"ignoreCase": false,
|
||||
"expected": 3,
|
||||
},
|
||||
];
|
||||
|
||||
// Run tests
|
||||
for (var t in tests) {
|
||||
print("Running test: ${t["name"]}");
|
||||
expect(ld(t["s"], t["t"], t["ignoreCase"]), t["expected"]);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user