Skip to content

Commit a9d2319

Browse files
committed
test: unmappable native cannot be unified with_encrypted
1 parent 767057e commit a9d2319

File tree

1 file changed

+40
-1
lines changed

1 file changed

+40
-1
lines changed

packages/cipherstash-proxy-integration/src/select/unmappable.rs

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ mod tests {
1010
/// Test ensures that unmappable SQL statements return an error
1111
///
1212
#[tokio::test]
13-
async fn unmappable_error() {
13+
async fn unmappable_table_not_found() {
1414
let client = connect_with_tls(PROXY).await;
1515

1616
let sql = "SELECT blah FROM vtha";
@@ -21,4 +21,43 @@ mod tests {
2121
"Expected unmappble SQL statement to return an error",
2222
);
2323
}
24+
25+
#[tokio::test]
26+
async fn unmappable_column_not_found() {
27+
let client = connect_with_tls(PROXY).await;
28+
29+
let sql = "SELECT blah FROM encrypted";
30+
let result = client.query(sql, &[]).await;
31+
32+
assert!(
33+
result.is_err(),
34+
"Expected unmappble SQL statement to return an error",
35+
);
36+
}
37+
38+
#[tokio::test]
39+
async fn unmappable_native_cannot_be_unified_with_encrypted() {
40+
let client = connect_with_tls(PROXY).await;
41+
42+
let sql = "SELECT * FROM encrypted WHERE plaintext = encrypted_text";
43+
let result = client.query(sql, &[]).await;
44+
45+
assert!(
46+
result.is_err(),
47+
"Expected unmappble SQL statement to return an error",
48+
);
49+
}
50+
51+
#[tokio::test]
52+
async fn unmappable_syntax_error() {
53+
let client = connect_with_tls(PROXY).await;
54+
55+
let sql = "SELECT *, FROM encrypted";
56+
let result = client.query(sql, &[]).await;
57+
58+
assert!(
59+
result.is_err(),
60+
"Expected unmappble SQL statement to return an error",
61+
);
62+
}
2463
}

0 commit comments

Comments
 (0)