Skip to content

Commit a102ae1

Browse files
committed
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.
1 parent f5b8805 commit a102ae1

File tree

97 files changed

+58
-57
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+58
-57
lines changed

tests/core/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ async fn test_routing_with_prefix() {
8888

8989
let app_data = actix_web::web::Data::new(state);
9090
let resp = req_path_with_app_data(
91-
"/prefix/tests/sql_test_files/component_rendering/it_works_simple.sql",
91+
"/prefix/tests/sql_test_files/component_rendering/simple.sql",
9292
app_data.clone(),
9393
)
9494
.await
@@ -122,7 +122,7 @@ async fn test_routing_with_prefix() {
122122
assert!(resp.to_lowercase().contains("forbidden"), "{resp}");
123123

124124
let resp = req_path_with_app_data(
125-
"/tests/sql_test_files/component_rendering/it_works_simple.sql",
125+
"/tests/sql_test_files/component_rendering/simple.sql",
126126
app_data,
127127
)
128128
.await

tests/core/select_temp_t.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
-- see tests/sql_test_files/component_rendering/it_works_temp_table_accessible_in_run_sql_nomssql.sql
1+
-- see tests/sql_test_files/component_rendering/temp_table_accessible_in_run_sql_nomssql.sql
22
select 'text' as component, x as contents from temp_t;

tests/data_formats/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ async fn test_json_columns() {
9696
#[actix_web::test]
9797
async fn test_accept_json_returns_json_array() -> actix_web::Result<()> {
9898
let resp = req_with_accept(
99-
"/tests/sql_test_files/component_rendering/it_works_simple.sql",
99+
"/tests/sql_test_files/component_rendering/simple.sql",
100100
"application/json",
101101
)
102102
.await?;
@@ -117,7 +117,7 @@ async fn test_accept_json_returns_json_array() -> actix_web::Result<()> {
117117
#[actix_web::test]
118118
async fn test_accept_ndjson_returns_jsonlines() -> actix_web::Result<()> {
119119
let resp = req_with_accept(
120-
"/tests/sql_test_files/component_rendering/it_works_simple.sql",
120+
"/tests/sql_test_files/component_rendering/simple.sql",
121121
"application/x-ndjson",
122122
)
123123
.await?;
@@ -144,7 +144,7 @@ async fn test_accept_ndjson_returns_jsonlines() -> actix_web::Result<()> {
144144
#[actix_web::test]
145145
async fn test_accept_html_returns_html() -> actix_web::Result<()> {
146146
let resp = req_with_accept(
147-
"/tests/sql_test_files/component_rendering/it_works_simple.sql",
147+
"/tests/sql_test_files/component_rendering/simple.sql",
148148
"text/html",
149149
)
150150
.await?;
@@ -161,7 +161,7 @@ async fn test_accept_html_returns_html() -> actix_web::Result<()> {
161161
#[actix_web::test]
162162
async fn test_accept_wildcard_returns_html() -> actix_web::Result<()> {
163163
let resp = req_with_accept(
164-
"/tests/sql_test_files/component_rendering/it_works_simple.sql",
164+
"/tests/sql_test_files/component_rendering/simple.sql",
165165
"*/*",
166166
)
167167
.await?;

tests/server_timing/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ async fn test_server_timing_disabled_in_production() -> actix_web::Result<()> {
1010
let app_data = make_app_data_from_config(config).await;
1111

1212
let req = crate::common::get_request_to_with_data(
13-
"/tests/sql_test_files/component_rendering/it_works_simple.sql",
13+
"/tests/sql_test_files/component_rendering/simple.sql",
1414
app_data,
1515
)
1616
.await?
@@ -32,7 +32,7 @@ async fn test_server_timing_enabled_in_development() -> actix_web::Result<()> {
3232
let app_data = make_app_data_from_config(config).await;
3333

3434
let req = crate::common::get_request_to_with_data(
35-
"/tests/sql_test_files/data/it_works_postgres_cast_syntax.sql",
35+
"/tests/sql_test_files/data/postgres_cast_syntax.sql",
3636
app_data,
3737
)
3838
.await?
@@ -72,7 +72,7 @@ async fn test_server_timing_enabled_in_development() -> actix_web::Result<()> {
7272

7373
#[actix_web::test]
7474
async fn test_server_timing_format() -> actix_web::Result<()> {
75-
let req = get_request_to("/tests/sql_test_files/data/it_works_postgres_cast_syntax.sql")
75+
let req = get_request_to("/tests/sql_test_files/data/postgres_cast_syntax.sql")
7676
.await?
7777
.to_srv_request();
7878
let resp = main_handler(req).await?;

tests/sql_test_files/README.md

Lines changed: 5 additions & 5 deletions

0 commit comments

Comments
 (0)