|
1 | 1 | use crate::helpers::{convert_outcome, run_convert}; |
2 | | -use crate::test_types::ConvertTestCase; |
| 2 | +use crate::test_types::{ConvertTestCase, ValueTestCase}; |
3 | 3 |
|
4 | 4 | // The distributions workflow also runs this test and the full convert test in test_convert.rs with |
5 | 5 | // DuckDB compiled in (`--features bundled`), as the wheels build it. |
@@ -43,9 +43,27 @@ fn given_zone_free_snowflake_sql_when_converting_then_the_checking_engine_binds_ |
43 | 43 | // it. The distributions workflow runs this with DuckDB compiled in as well. |
44 | 44 | #[test] |
45 | 45 | fn given_the_linked_duckdb_when_asked_its_version_then_it_names_the_pinned_release() { |
| 46 | + let test_cases = [ |
| 47 | + ValueTestCase { |
| 48 | + description: "version() names the release, not a dev build", |
| 49 | + sql: "SELECT version()", |
| 50 | + expected_value: "v2.0.0", |
| 51 | + }, |
| 52 | + ValueTestCase { |
| 53 | + description: "pragma_version's library version names the same release", |
| 54 | + sql: "SELECT library_version FROM pragma_version()", |
| 55 | + expected_value: "v2.0.0", |
| 56 | + }, |
| 57 | + ]; |
46 | 58 | let connection = duckdb::Connection::open_in_memory().expect("in-memory DuckDB opens"); |
47 | | - let version: String = connection |
48 | | - .query_row("SELECT version()", [], |row| row.get(0)) |
49 | | - .expect("DuckDB reports its version"); |
50 | | - assert_eq!(version, "v2.0.0", "the DuckDB release SQLQuack pins"); |
| 59 | + for test_case in test_cases { |
| 60 | + let version: String = connection |
| 61 | + .query_row(test_case.sql, [], |row| row.get(0)) |
| 62 | + .expect(test_case.description); |
| 63 | + assert_eq!( |
| 64 | + version, test_case.expected_value, |
| 65 | + "{}", |
| 66 | + test_case.description |
| 67 | + ); |
| 68 | + } |
51 | 69 | } |
0 commit comments