Skip to content

Commit

Permalink
Rename FixedString tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ThatNintendoNerd committed Feb 21, 2024
1 parent eedbaab commit 96dddb3
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lvd_lib/src/string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ mod tests {
use binrw::{io::Cursor, BinReaderExt, BinWriterExt};

#[test]
fn read_lvd_fixed_string() {
fn read_fixed_string() {
// Test initialized string buffer.
let mut reader = Cursor::new(b"COL_00_Floor01\0\0");
let value = reader.read_be_args::<FixedString<16>>((1,)).unwrap();
Expand All @@ -290,7 +290,7 @@ mod tests {
}

#[test]
fn read_lvd_fixed_string_empty() {
fn read_fixed_string_empty() {
// Test initialized string buffer.
let mut reader = Cursor::new(b"\0\0\0\0\0\0\0\0");
let value = reader.read_be_args::<FixedString<8>>((1,)).unwrap();
Expand All @@ -305,15 +305,15 @@ mod tests {
}

#[test]
fn read_lvd_fixed_string_missing_nul() {
fn read_fixed_string_missing_nul() {
let mut reader = Cursor::new(b"DEATH_00");
let result = reader.read_be_args::<FixedString<8>>((1,));

assert!(result.is_err());
}

#[test]
fn lvd_fixed_string_from_str() {
fn fixed_string_from_str() {
// Test empty string.
let s = "";
let value = FixedString::<8>::from_str(s).unwrap();
Expand All @@ -331,7 +331,7 @@ mod tests {
}

#[test]
fn write_lvd_fixed_string() {
fn write_fixed_string() {
let value = FixedString::<8>::from_str("curve1").unwrap();
let mut writer = Cursor::new(Vec::new());

Expand All @@ -341,7 +341,7 @@ mod tests {
}

#[test]
fn write_lvd_fixed_string_empty() {
fn write_fixed_string_empty() {
let value = FixedString::<8>::new();
let mut writer = Cursor::new(Vec::new());

Expand Down

0 comments on commit 96dddb3

Please sign in to comment.