diff options
| author | David Schlachter <t480-debian-git@schlachter.ca> | 2025-11-10 00:24:57 -0500 |
|---|---|---|
| committer | David Schlachter <t480-debian-git@schlachter.ca> | 2025-11-10 00:24:57 -0500 |
| commit | 282df9321e7911285aa18673fdeb562298890b41 (patch) | |
| tree | 85626d5c23df9f9426084b1d690afc27ad79ba8b | |
| parent | 3a571437c9af78cefad3d3b225accdfb38561eb3 (diff) | |
Add simple test
| -rw-r--r-- | main_test.go | 18 | ||||
| -rw-r--r-- | testdata/test_tasks.txt | 5 |
2 files changed, 23 insertions, 0 deletions
diff --git a/main_test.go b/main_test.go new file mode 100644 index 0000000..3e79bf9 --- /dev/null +++ b/main_test.go @@ -0,0 +1,18 @@ +package main + +import ( + "testing" +) + +func TestMain(t *testing.T) { + tasks, err := readInput("testdata/test_tasks.txt") + if err != nil { + t.Logf("Expected no error when reading input file, got '%s'", err) + t.FailNow() + } + + if len(tasks) != 3 { + t.Logf("Expected 3 tasks to be parsed, got %d", len(tasks)) + t.FailNow() + } +} diff --git a/testdata/test_tasks.txt b/testdata/test_tasks.txt new file mode 100644 index 0000000..f242539 --- /dev/null +++ b/testdata/test_tasks.txt @@ -0,0 +1,5 @@ +# This is a comment +0 18 * * Mon Take out garbage, recycling, compost +30 8 * * Sun Water indoor plants + +0 10 * 4-10 * Water outdoor plants |
