Skip to content

Commit c421426

Browse files
committed
Run cargo fmt on tests
1 parent 0bca5dc commit c421426

File tree

1 file changed

+17
-15
lines changed

1 file changed

+17
-15
lines changed

tests/lib.rs

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
extern crate bytebuffer;
22

33
use bytebuffer::*;
4-
use std::io::{Read, Write, ErrorKind};
4+
use std::io::{ErrorKind, Read, Write};
55

66
#[test]
77
fn test_empty() {
@@ -25,7 +25,7 @@ fn test_u16() {
2525
}
2626

2727
#[test]
28-
fn test_u16_little_endian(){
28+
fn test_u16_little_endian() {
2929
let mut buffer = ByteBuffer::new();
3030
buffer.set_endian(Endian::LittleEndian);
3131
buffer.write_u16(0xF0E1);
@@ -84,7 +84,6 @@ fn test_string() {
8484
assert_eq!(buffer.read_string().unwrap(), "hello");
8585
}
8686

87-
8887
#[test]
8988
fn test_mixed() {
9089
let mut buffer = ByteBuffer::new();
@@ -111,10 +110,12 @@ fn test_string_overread_protection() {
111110
fn test_to_string() {
112111
let mut buffer = ByteBuffer::new();
113112
buffer.write_string("hello");
114-
assert_eq!(buffer.to_hex_dump(), "0x00 0x00 0x00 0x05 0x68 0x65 0x6c 0x6c 0x6f");
113+
assert_eq!(
114+
buffer.to_hex_dump(),
115+
"0x00 0x00 0x00 0x05 0x68 0x65 0x6c 0x6c 0x6f"
116+
);
115117
}
116118

117-
118119
#[test]
119120
fn test_wpos() {
120121
let mut buffer = ByteBuffer::new();
@@ -264,47 +265,45 @@ fn test_write() {
264265
fn test_flush() {
265266
let mut buffer = ByteBuffer::new();
266267
buffer.flush().unwrap();
267-
268268
}
269269

270270
#[test]
271-
fn cloning_and_read(){
271+
fn cloning_and_read() {
272272
let mut buffer = ByteBuffer::new();
273273
for i in 0..10u8 {
274274
buffer.write_u8(i);
275275
}
276276

277-
278277
let mut clone = buffer.clone();
279278
for i in 0..10u8 {
280279
assert_eq!(i, clone.read_u8().unwrap());
281280
}
282281
}
283282

284283
#[test]
285-
fn cursors_reset(){
284+
fn cursors_reset() {
286285
let mut buffer = ByteBuffer::new();
287286
for i in 0..10u8 {
288287
buffer.write_u8(i);
289288
buffer.read_u8().unwrap();
290289
}
291290

292291
buffer.reset_cursors();
293-
292+
294293
for i in 0..10u8 {
295294
assert_eq!(i, buffer.read_u8().unwrap());
296295
}
297296
}
298297

299-
300-
301-
302298
#[test]
303299
fn test_debug() {
304300
let mut buffer = ByteBuffer::from_bytes(&[0x1, 0xFF, 0x45]);
305301
buffer.read_u8().unwrap();
306302
let debug_string = format!("{:?}", buffer);
307-
assert_eq!(&debug_string, "ByteBuffer { remaining_data: [255, 69], total_data: [1, 255, 69], endian: BigEndian }");
303+
assert_eq!(
304+
&debug_string,
305+
"ByteBuffer { remaining_data: [255, 69], total_data: [1, 255, 69], endian: BigEndian }"
306+
);
308307
}
309308

310309
#[test]
@@ -316,7 +315,10 @@ fn test_debug_with_bit_reads() {
316315
let next_four_bits = buffer.read_bits(4).unwrap();
317316
assert_eq!(buffer.get_rpos(), 1);
318317
let remaining = buffer.read_bits(16).unwrap();
319-
assert_eq!(&debug_string, "ByteBuffer { remaining_data: [255, 69], total_data: [1, 255, 69], endian: BigEndian }");
318+
assert_eq!(
319+
&debug_string,
320+
"ByteBuffer { remaining_data: [255, 69], total_data: [1, 255, 69], endian: BigEndian }"
321+
);
320322
assert_eq!(first_four_bits, 0);
321323
assert_eq!(next_four_bits, 1);
322324
assert_eq!(remaining, 65349);

0 commit comments

Comments
 (0)