Browse Source

Change character byte definitions into b'X' form

feature_link
Anton Tarasenko 3 years ago
parent
commit
bb1f73a755
  1. 44
      src/link/mod.rs

44
src/link/mod.rs

@ -172,27 +172,27 @@ fn message_push_byte() {
reader.push_byte(0).unwrap();
reader.push_byte(0).unwrap();
reader.push_byte(13).unwrap();
reader.push_byte(0x48).unwrap(); // H
reader.push_byte(0x65).unwrap(); // e
reader.push_byte(0x6c).unwrap(); // l
reader.push_byte(0x6c).unwrap(); // l
reader.push_byte(0x6f).unwrap(); // o
reader.push_byte(0x2c).unwrap(); // ,
reader.push_byte(0x20).unwrap(); // <space>
reader.push_byte(0x77).unwrap(); // w
reader.push_byte(0x6f).unwrap(); // o
reader.push_byte(0x72).unwrap(); // r
reader.push_byte(0x6c).unwrap(); // l
reader.push_byte(0x64).unwrap(); // d
reader.push_byte(0x21).unwrap(); // <exclamation mark>
reader.push_byte(b'H').unwrap();
reader.push_byte(b'e').unwrap();
reader.push_byte(b'l').unwrap();
reader.push_byte(b'l').unwrap();
reader.push_byte(b'o').unwrap();
reader.push_byte(b',').unwrap();
reader.push_byte(b' ').unwrap();
reader.push_byte(b'w').unwrap();
reader.push_byte(b'o').unwrap();
reader.push_byte(b'r').unwrap();
reader.push_byte(b'l').unwrap();
reader.push_byte(b'd').unwrap();
reader.push_byte(b'!').unwrap();
reader.push_byte(HEAD_UE_MESSAGE).unwrap();
reader.push_byte(0).unwrap();
reader.push_byte(0).unwrap();
reader.push_byte(0).unwrap();
reader.push_byte(3).unwrap();
reader.push_byte(0x59).unwrap(); // Y
reader.push_byte(0x6f).unwrap(); // o
reader.push_byte(0x21).unwrap(); // <exclamation mark>
reader.push_byte(b'Y').unwrap();
reader.push_byte(b'o').unwrap();
reader.push_byte(b'!').unwrap();
assert_eq!(reader.pop().unwrap(), "Hello, world!");
assert_eq!(reader.pop().unwrap(), "Yo!");
assert_eq!(reader.pop(), None);
@ -233,9 +233,9 @@ fn mixed_push_byte() {
reader.push_byte(0).unwrap();
reader.push_byte(0).unwrap();
reader.push_byte(3).unwrap();
reader.push_byte(0x59).unwrap(); // Y
reader.push_byte(0x6f).unwrap(); // o
reader.push_byte(0x21).unwrap(); // <exclamation mark>
reader.push_byte(b'Y').unwrap();
reader.push_byte(b'o').unwrap();
reader.push_byte(b'!').unwrap();
reader.push_byte(HEAD_UE_RECEIVED).unwrap();
reader.push_byte(65).unwrap();
reader.push_byte(25).unwrap();
@ -261,9 +261,9 @@ fn pushing_many_bytes_at_once() {
0,
0,
3,
0x59, // Y
0x6f, // o
0x21, // <exclamation mark>
b'Y',
b'o',
b'!',
HEAD_UE_RECEIVED,
65,
25,

Loading…
Cancel
Save