Skip to content

Commit a5a85cb

Browse files
committed
simplify test case
1 parent 11c348e commit a5a85cb

File tree

1 file changed

+3
-25
lines changed

1 file changed

+3
-25
lines changed

tests/type_check.rs

Lines changed: 3 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -68,35 +68,13 @@ async fn check_tiny_int() {
6868
type_check::<_, sql_types::TinyInt>(conn, i8::MIN).await;
6969
type_check::<_, sql_types::TinyInt>(conn, i8::MAX).await;
7070

71-
#[derive(QueryableByName, Debug)]
72-
#[diesel(table_name = test_small)]
73-
struct Test {
74-
id: i8,
75-
}
76-
77-
table!(test_small(id){
78-
id -> TinyInt,
79-
});
80-
8171
// test case for https://github.com/weiznich/diesel_async/issues/91
82-
diesel::sql_query("drop table if exists test_small")
83-
.execute(conn)
84-
.await
85-
.unwrap();
86-
diesel::sql_query("create table test_small(id smallint primary key)")
87-
.execute(conn)
88-
.await
89-
.unwrap();
90-
diesel::sql_query("insert into test_small(id) values(-1)")
91-
.execute(conn)
92-
.await
93-
.unwrap();
94-
let got = diesel::sql_query("select id from test_small where id = ?")
72+
let res = diesel::dsl::sql::<diesel::sql_types::Bool>("SELECT -1 = ")
9573
.bind::<sql_types::TinyInt, _>(-1)
96-
.load::<Test>(conn)
74+
.get_result::<bool>(conn)
9775
.await
9876
.unwrap();
99-
assert_eq!(got[0].id, -1);
77+
assert!(res);
10078
}
10179

10280
#[cfg(feature = "mysql")]

0 commit comments

Comments
 (0)