Skip to content

Commit

Permalink
se: fix needless_raw_string_hashes
Browse files Browse the repository at this point in the history
  • Loading branch information
aqrln committed Aug 25, 2023
1 parent 7cad5db commit 72b556c
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ async fn aragon_test_cockroachdb(api: &mut TestApi) -> TestResult {

#[test_connector(tags(CockroachDb))]
async fn noalyss_folder_test_cockroachdb(api: &mut TestApi) -> TestResult {
let raw_sql = indoc! {r#"
let raw_sql = indoc! {r"
CREATE TABLE user_active_security (
id BIGSERIAL NOT NULL,
us_login STRING NOT NULL,
Expand All @@ -83,7 +83,7 @@ async fn noalyss_folder_test_cockroachdb(api: &mut TestApi) -> TestResult {
is_public CHAR(1) NOT NULL DEFAULT 'N',
CONSTRAINT ck_is_public CHECK (is_public = ANY ARRAY['Y':::STRING::CHAR, 'N':::STRING::CHAR]:::CHAR[])
);
"#};
"};

api.raw_cmd(raw_sql).await;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ async fn aragon_test_postgres(api: &mut TestApi) -> TestResult {

#[test_connector(tags(Postgres), exclude(CockroachDb))]
async fn noalyss_folder_test_postgres(api: &mut TestApi) -> TestResult {
let raw_sql = indoc! {r#"
let raw_sql = indoc! {r"
CREATE TABLE user_active_security (
id BIGSERIAL NOT NULL,
us_login TEXT NOT NULL,
Expand All @@ -81,7 +81,7 @@ async fn noalyss_folder_test_postgres(api: &mut TestApi) -> TestResult {
tl_id BIGSERIAL PRIMARY KEY,
is_public CHAR(1) NOT NULL DEFAULT 'N' CHECK (is_public IN ('Y', 'N'))
);
"#};
"};

api.raw_cmd(raw_sql).await;

Expand Down
32 changes: 16 additions & 16 deletions schema-engine/sql-introspection-tests/tests/tables/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ use sql_introspection_tests::test_api::*;

#[test_connector(tags(Mysql57))]
async fn nul_default_bytes(api: &mut TestApi) -> TestResult {
let create_table = indoc! {r#"
let create_table = indoc! {r"
CREATE TABLE nul_default_bytes
(
id INT NOT NULL
PRIMARY KEY,
val BINARY(5) DEFAULT '\0\0\0\0\0' NOT NULL
)
"#};
"};

api.database().raw_cmd(create_table).await?;

Expand Down Expand Up @@ -185,12 +185,12 @@ async fn a_table_with_unique_index(api: &mut TestApi) -> TestResult {
})
.await?;

let dm = indoc! {r##"
let dm = indoc! {r#"
model Blog {
id Int @id @default(autoincrement())
authorId Int @unique(map: "test")
}
"##};
"#};

let result = api.introspect().await?;
api.assert_eq_datamodels(dm, &result);
Expand All @@ -212,14 +212,14 @@ async fn a_table_with_multi_column_unique_index(api: &mut TestApi) -> TestResult
})
.await?;

let dm = indoc! {r##"
let dm = indoc! {r#"
model User {
id Int @id @default(autoincrement())
firstname Int
lastname Int
@@unique([firstname, lastname], map: "test")
}
"##};
"#};

let result = api.introspect().await?;
api.assert_eq_datamodels(dm, &result);
Expand Down Expand Up @@ -314,13 +314,13 @@ async fn a_table_with_a_non_unique_index(api: &mut TestApi) -> TestResult {
})
.await?;

let dm = indoc! {r##"
let dm = indoc! {r#"
model User {
a Int
id Int @id @default(autoincrement())
@@index([a], map: "test")
}
"##};
"#};

let result = api.introspect().await?;
api.assert_eq_datamodels(dm, &result);
Expand All @@ -343,14 +343,14 @@ async fn a_table_with_a_multi_column_non_unique_index(api: &mut TestApi) -> Test
})
.await?;

let dm = indoc! { r##"
let dm = indoc! { r#"
model User {
a Int
b Int
id Int @id @default(autoincrement())
@@index([a,b], map: "test")
}
"##};
"#};

let result = api.introspect().await?;
api.assert_eq_datamodels(dm, &result);
Expand Down Expand Up @@ -640,7 +640,7 @@ async fn different_default_values_should_work(api: &mut TestApi) -> TestResult {
})
.await?;

let dm = indoc! {r##"
let dm = indoc! {r#"
model Blog {
id Int @id @default(autoincrement())
text String? @default("one") @db.Text
Expand All @@ -650,7 +650,7 @@ async fn different_default_values_should_work(api: &mut TestApi) -> TestResult {
tinytext_float String @default(dbgenerated("(1.0)")) @db.TinyText
tinytext_short String @default(dbgenerated("(1)")) @db.TinyText
}
"##};
"#};

let result = api.introspect().await?;
api.assert_eq_datamodels(dm, &result);
Expand Down Expand Up @@ -782,11 +782,11 @@ async fn unique_and_index_on_same_field_works_mysql(api: &mut TestApi) -> TestRe

api.raw_cmd(setup).await;

let dm = indoc! {r##"
let dm = indoc! {r#"
model users {
id BigInt @id @unique(map: "id") @default(autoincrement()) @db.UnsignedBigInt
}
"##};
"#};

let result = api.introspect().await?;
api.assert_eq_datamodels(dm, &result);
Expand All @@ -805,11 +805,11 @@ async fn unique_and_index_on_same_field_works_mariadb(api: &mut TestApi) -> Test

api.raw_cmd(setup).await;

let dm = indoc! {r##"
let dm = indoc! {r#"
model users {
id Int @id @unique(map: "really_must_be_different")
}
"##};
"#};

let result = api.introspect().await?;
api.assert_eq_datamodels(dm, &result);
Expand Down

0 comments on commit 72b556c

Please sign in to comment.