Skip to content

Commit 27ccb65

Browse files
committed
fix tests
1 parent d15cd38 commit 27ccb65

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/decode.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ fn decode_helper(
216216
// trailing whitespace is so common that it's worth it to check the last byte to
217217
// possibly return a better error message
218218
if let Some(b) = input.last() {
219-
if decode_table[*b as usize] == tables::INVALID_VALUE {
219+
if *b != b'=' && decode_table[*b as usize] == tables::INVALID_VALUE {
220220
return Err(DecodeError::InvalidByte(input.len() - 1, *b));
221221
}
222222
}

tests/decode.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ fn decode_reject_invalid_bytes_with_correct_error() {
292292
index
293293
);
294294

295-
if length % 4 == 1 {
295+
if length % 4 == 1 && !suffix.is_empty() {
296296
assert_eq!(DecodeError::InvalidLength, decode(&input).unwrap_err());
297297
} else {
298298
assert_eq!(

0 commit comments

Comments
 (0)