Files
sqlpage--sqlpage/tests/sql_test_files/data/immutable_variables.sql
Ophir LOJKINE 95f228f383 simplify SQL test files (#1129)
* simplify SQL test files

- Simplified SQL test files by removing unnecessary components and restructuring queries to focus on expected vs actual results.
- Updated the request handling in `run_sql_test` to differentiate between JSON and HTML responses based on test file content.
- Enhanced error handling and assertions for both JSON and HTML responses to improve test reliability and clarity.
- Removed redundant code and improved readability in the test execution flow.

* move more tests to the new expected/actual format

* migrate more tests to the expected/actual format

- Changed references in various test files to point to the new `simple.sql` instead of the outdated `it_works_simple.sql`.
- Removed several obsolete SQL test files that are no longer needed, streamlining the test suite.
- Updated assertions and request paths in the test cases to reflect the new structure and improve clarity.

* Enhance error handling in SQL tests and update SQL syntax

- Added a new function `format_error` to improve error reporting in SQL test assertions, capturing detailed error descriptions and backtraces.
- Updated SQL syntax in `sqrt.sql` to use `INT` instead of `integer` for consistency with SQL standards.

* sqrt test
2025-11-26 00:45:13 +01:00

11 lines
561 B
SQL

set x = 'set_value';
set set_only = 'only_in_set';
select 'set_value' as expected, $x as actual;
select 'only_in_set' as expected, $set_only as actual;
select '{"x":"1"}' as expected, sqlpage.variables('get') as actual;
select '"x":"set_value"' as expected_contains, sqlpage.variables('set') as actual;
select '"set_only":"only_in_set"' as expected_contains, sqlpage.variables('set') as actual;
select '"x":"set_value"' as expected_contains, sqlpage.variables() as actual;
select '"set_only":"only_in_set"' as expected_contains, sqlpage.variables() as actual;