Skip to content

Commit e3d419d

Browse files
committed
byte_literal test
1 parent 3dc75ca commit e3d419d

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

src/unparser.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -930,8 +930,9 @@ impl Unparser {
930930
}
931931
Constant::Bytes(value) => {
932932
let utf8 = String::from_utf8(value.to_owned());
933-
933+
self.write_str("b\"");
934934
self.write_str(&utf8.unwrap());
935+
self.write_str("\"");
935936
}
936937
Constant::Int(value) => self.write_str(&value.to_string()),
937938
Constant::Str(value) => self.write_str(&format!("\"{}\"", value)),

test_files/byte_literal.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
byte_literal = b"hello"

0 commit comments

Comments
 (0)