Skip to content

Add tests for core modules - #332

Draft
troglodyne-bot wants to merge 1 commit into
Troglodyne-Internet-Widgets:masterfrom
troglodyne-bot:koan/fix-issue-5
Draft

Add tests for core modules#332
troglodyne-bot wants to merge 1 commit into
Troglodyne-Internet-Widgets:masterfrom
troglodyne-bot:koan/fix-issue-5

Conversation

@troglodyne-bot

Copy link
Copy Markdown
Contributor

Summary

Adds a test suite for the core tCMS modules identified in issue #5. Tests cover observable behavior (return values, DB state, exceptions) using real in-memory SQLite databases where SQL logic is involved, and lightweight package stubs for modules with heavy native dependencies.

Closes #5

Changes

  • t/Trog-SQLite.t: Fix pre-existing errstr mock gap causing a test failure
  • t/Trog-Utils.t: Tests for coerce_array, strip_and_trunc, uuid, mime_type
  • t/Trog-Config.t: Tests for config file precedence (main > default) and missing-config die
  • t/Trog-Data.t: Tests for factory dispatch and instance memoization
  • t/Trog-Auth.t: Tests for session, user lookup, ACL, useradd, and mksession — uses a real in-memory SQLite DB seeded from schema/auth.schema
  • t/Trog-SQLite-TagIndex.t: Tests for tags, routes, aliases, posts_for_tags — uses a real in-memory SQLite DB seeded from schema/flatfile.schema

Test plan

  • PERL5LIB=<local-perl5>/lib/perl5 prove -Ilib t/ → 6 files, 37 tests, all pass
  • Required CPAN modules installed locally: Test::MockModule, Test::Fatal, Config::Simple, FindBin::libs, DBI, DBD::SQLite, Plack, Mojolicious

Generated by Kōan

…og::Auth, Trog::SQLite::TagIndex

Closes Troglodyne-Internet-Widgets#5

- Fix pre-existing errstr mock gap in t/Trog-SQLite.t (dbh subtest)
- t/Trog-Utils.t: tests for coerce_array, strip_and_trunc, uuid, mime_type
- t/Trog-Config.t: tests for get() precedence and missing-config die
- t/Trog-Data.t: tests for factory dispatch and memoization
- t/Trog-Auth.t: tests for session, user, ACL, and useradd/mksession using
  a real in-memory SQLite database seeded from the auth schema
- t/Trog-SQLite-TagIndex.t: tests for tags, routes, aliases, posts_for_tags
  using a real in-memory SQLite database seeded from the flatfile schema

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add tests

1 participant