From d7c738bbd3e2ce8a496ab7b4093d14bf9a8c5137 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Sun, 2 Nov 2025 23:09:24 +0000 Subject: [PATCH] refactor(tests): Co-locate tests with source code Moves all test files from the `tdd/` directory to their corresponding `pkg/` subdirectories. This aligns with standard Go project structure and simplifies the test coverage workflow. - Moves `tdd/crypt/crypt_test.go` to `pkg/crypt/` - Moves `tdd/enchantrix/enchantrix_test.go` to `pkg/enchantrix/` - Moves `tdd/trix/trix_test.go` to `pkg/trix/` - Simplifies the `Taskfile.yml` to use a standard `go test` command. - Removes the now-obsolete `tdd/` directory. - Adds generated coverage files to `.gitignore`. --- .gitignore | 5 +++++ Taskfile.yml | 4 ++-- {tdd => pkg}/crypt/crypt_test.go | 0 {tdd => pkg}/enchantrix/enchantrix_test.go | 0 {tdd => pkg}/trix/trix_test.go | 0 5 files changed, 7 insertions(+), 2 deletions(-) rename {tdd => pkg}/crypt/crypt_test.go (100%) rename {tdd => pkg}/enchantrix/enchantrix_test.go (100%) rename {tdd => pkg}/trix/trix_test.go (100%) diff --git a/.gitignore b/.gitignore index 3a4cf3c..1334267 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,8 @@ node_modules package-lock.json .idea go.sum +covdata/ +merged_covdata/ +coverage.txt +coverage.html +coverage.out diff --git a/Taskfile.yml b/Taskfile.yml index afd7d76..2808a2b 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -2,9 +2,9 @@ version: '3' tasks: test: - desc: "Run all tests" + desc: "Run all tests and generate a coverage report" cmds: - - go test -v ./... + - go test -v -coverprofile=coverage.out ./... build: desc: "Build the project" diff --git a/tdd/crypt/crypt_test.go b/pkg/crypt/crypt_test.go similarity index 100% rename from tdd/crypt/crypt_test.go rename to pkg/crypt/crypt_test.go diff --git a/tdd/enchantrix/enchantrix_test.go b/pkg/enchantrix/enchantrix_test.go similarity index 100% rename from tdd/enchantrix/enchantrix_test.go rename to pkg/enchantrix/enchantrix_test.go diff --git a/tdd/trix/trix_test.go b/pkg/trix/trix_test.go similarity index 100% rename from tdd/trix/trix_test.go rename to pkg/trix/trix_test.go