Skip to content

Commit

Permalink
chore: add tests for zero-length encoding of varlen columns
Browse files Browse the repository at this point in the history
  • Loading branch information
Weakky committed Apr 23, 2024
1 parent ba4ebc0 commit cf9eecd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/tds/codec/column_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -722,7 +722,10 @@ mod tests {

assert_eq!(nd, d);

reader.read_u8().await.expect_err("decode must consume entire buffer");
reader
.read_u8()
.await
.expect_err("decode must consume entire buffer");
}

#[tokio::test]
Expand Down
4 changes: 4 additions & 0 deletions tests/bulk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,10 @@ test_bulk_type!(smallint("SMALLINT", 2000, 0..2000i16));
test_bulk_type!(int("INT", 2000, 0..2000i32));
test_bulk_type!(bigint("BIGINT", 2000, 0..2000i64));

test_bulk_type!(empty_varchar("VARCHAR(MAX)", 1, [""].into_iter()));
test_bulk_type!(empty_nvarchar("NVARCHAR(MAX)", 1, [""].into_iter()));
test_bulk_type!(empty_varbinary("VARBINARY(MAX)", 1, [b""].into_iter()));

test_bulk_type!(real(
"REAL",
1000,
Expand Down

0 comments on commit cf9eecd

Please sign in to comment.