forked from rust-db/barrel
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixing an issue in the string generator which shouldn't have been an …
…issue. Adding sqlite unit tests, making then all tests run and build conditional features in the ci so that we can actually test our code properly 🤷
- Loading branch information
Katharina Sabel
committed
May 26, 2018
1 parent
d8f87b7
commit 9434a06
Showing
7 changed files
with
109 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
//! A few simple tests for the sqlite3 string backend | ||
mod simple; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
//! Other simple table/ column migrations | ||
#![allow(unused_imports)] | ||
|
||
use backend::{SqlGenerator, Sqlite}; | ||
|
||
|
||
#[test] | ||
fn create_table() { | ||
let sql = Sqlite::create_table("table_to_create"); | ||
assert_eq!(String::from("CREATE TABLE \"table_to_create\""), sql); | ||
} | ||
|
||
#[test] | ||
fn create_table_if_not_exists() { | ||
let sql = Sqlite::create_table_if_not_exists("table_to_create"); | ||
assert_eq!(String::from("CREATE TABLE IF NOT EXISTS \"table_to_create\""), sql); | ||
} | ||
|
||
#[test] | ||
fn drop_table() { | ||
let sql = Sqlite::drop_table("table_to_drop"); | ||
assert_eq!(String::from("DROP TABLE \"table_to_drop\""), sql); | ||
} | ||
|
||
#[test] | ||
fn drop_table_if_exists() { | ||
let sql = Sqlite::drop_table_if_exists("table_to_drop"); | ||
assert_eq!(String::from("DROP TABLE IF EXISTS \"table_to_drop\""), sql); | ||
} | ||
|
||
#[test] | ||
fn rename_table() { | ||
let sql = Sqlite::rename_table("old_table", "new_table"); | ||
assert_eq!(String::from("ALTER TABLE \"old_table\" RENAME TO \"new_table\""), sql); | ||
} | ||
|
||
#[test] | ||
fn alter_table() { | ||
let sql = Sqlite::alter_table("table_to_alter"); | ||
assert_eq!(String::from("ALTER TABLE \"table_to_alter\""), sql); | ||
} |