()
| 485 | |
| 486 | #[test] |
| 487 | fn test_empty_sql_file() -> Result<(), Box<dyn std::error::Error>> { |
| 488 | // SETUP |
| 489 | let dir = tempdir()?; |
| 490 | let dir_path = dir.path(); |
| 491 | let sql_file = dir_path.join("empty.sql"); |
| 492 | |
| 493 | fs::write(&sql_file, "")?; |
| 494 | |
| 495 | // EXECUTE |
| 496 | let mut cmd = cargo_bin_cmd!("sqlx-ts"); |
| 497 | cmd |
| 498 | .arg(dir_path.to_str().unwrap()) |
| 499 | .arg("--ext=sql") |
| 500 | .arg("--db-type=postgres") |
| 501 | .arg("--db-host=127.0.0.1") |
| 502 | .arg("--db-port=54321") |
| 503 | .arg("--db-user=postgres") |
| 504 | .arg("--db-pass=postgres") |
| 505 | .arg("--db-name=postgres"); |
| 506 | |
| 507 | // ASSERT |
| 508 | cmd |
| 509 | .assert() |
| 510 | .success() |
| 511 | .stdout(predicates::str::contains("No SQL queries found")) |
| 512 | .stdout(predicates::str::contains("No SQL errors detected!")); |
| 513 | |
| 514 | Ok(()) |
| 515 | } |
| 516 | |
| 517 | #[test] |
| 518 | fn test_playpen_schema_inventory_items_relationship() -> Result<(), Box<dyn std::error::Error>> { |
nothing calls this directly
no outgoing calls
no test coverage detected