Files
bolt/test/bolt_test.dart
Darwin Cereska fb3c0a7474 feat: init
2026-03-27 19:39:50 +01:00

54 lines
1.3 KiB
Dart

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"]);
}
});
});
}