Skip to content

Conversation

nicholashanson
Copy link
Contributor

Continued refactor of unittest.cpp by moving mustache-related tests to unit_tests/test_mustache.cpp.

Improved test coverage of mustache by adding 12 additional unit tests.

Additionally removed gobbing of test files form CMakeLists.txt and instead included test files explicitly.

- Moved tests that depend solely on `crow::response` from unittest.cpp
  to tests/unit_tests/test_http_response.cpp for clearer separation of concerns.
- Renamed the original "simple_response_routing_params" test in
  unittest.cpp to "routing_params" to reflect this chage.
- Updated CMakeLists.txt to automatically include all sources under unit_tests/.
Isolated unit tests that depend only on the utility module into test_utility.cpp.
- Moved Mustache-related tests from unittest.cpp to a new file: test_mustache.cpp
- Added coverage for:
  * Nested keys (e.g., user.name, user.address.city)
  * Function-returned template strings (including empty strings)
  * Lists and inverse/else blocks
  * HTML escaping, triple mustache, and unescaped tags
  * Custom template loader and partials
  * Multiline templates with proper indentation
  * Numeric and boolean values
- Removed Mustache tests from unittest.cpp for better organization
- Updated CMakeLists.txt to list test files explicitly (no globbing).
@gittiver
Copy link
Member

CMake Error at tests/CMakeLists.txt:35 (add_executable):
Cannot find source file:

unit_tests/test_json.cpp

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.

2 participants