From b203e4f97f950b008819b662003c2ef4a9f0e790 Mon Sep 17 00:00:00 2001 From: zontreck Date: Sun, 25 May 2025 00:01:08 -0700 Subject: [PATCH] Repair testsuites --- test/ciphers.dart | 11 +++++++++-- test/io_test.dart | 2 +- test/time_test.dart | 5 +++-- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/test/ciphers.dart b/test/ciphers.dart index eed6764..d6ced81 100644 --- a/test/ciphers.dart +++ b/test/ciphers.dart @@ -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)); }); } diff --git a/test/io_test.dart b/test/io_test.dart index 6924180..cd8f075 100644 --- a/test/io_test.dart +++ b/test/io_test.dart @@ -11,7 +11,7 @@ Future main() async { }); test("Test directory size checking", () async { - expect(await getDirectorySize("test"), 121680); + expect(await getDirectorySize("test"), 121956); }); test("Test file info methods", () async { diff --git a/test/time_test.dart b/test/time_test.dart index ff52ff4..2877449 100644 --- a/test/time_test.dart +++ b/test/time_test.dart @@ -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);