Repair testsuites

This commit is contained in:
zontreck 2025-05-25 00:01:08 -07:00
parent 7df013a6aa
commit b203e4f97f
3 changed files with 13 additions and 5 deletions

View file

@ -3,7 +3,14 @@ import 'package:test/expect.dart';
import 'package:test/scaffolding.dart';
void main() {
test("DBIKC", () {
expect("KAZNIA", DoubleBreastedInterruptedKeyCipher.encode("RUBNIU"));
// Various tests!
test("DBIKC", () async {
// This test will check if DBIKC properly encodes.
String input = "KAZNIA";
String expected = "RUBIU";
String encoded = DoubleBreastedInterruptedKeyCipher.encode(input);
expect(expected, encoded);
expect(input, DoubleBreastedInterruptedKeyCipher.decode(encoded));
});
}

View file

@ -11,7 +11,7 @@ Future<void> main() async {
});
test("Test directory size checking", () async {
expect(await getDirectorySize("test"), 121680);
expect(await getDirectorySize("test"), 121956);
});
test("Test file info methods", () async {

View file

@ -6,7 +6,7 @@ void main() {
test("Parse time notation", () {
Time time = Time.fromNotation("4h9s");
expect(time.toString(), "4h9s");
expect(time.toString(), "4h 9s");
expect(time.hours, 4);
expect(time.minutes, 0);
expect(time.seconds, 9);
@ -15,8 +15,9 @@ void main() {
test("Add time", () {
// Depends on first test working!
Time time = Time.fromNotation("4h9s");
time.add(Time(hours: 0, minutes: 80, seconds: 1));
time.add(Time(days: 0, hours: 0, minutes: 80, seconds: 1));
expect(time.days, 0);
expect(time.hours, 5);
expect(time.minutes, 20);
expect(time.seconds, 10);