Skip to content

Commit

Permalink
testing
Browse files Browse the repository at this point in the history
* Introduces a test to verify that the optional `PROJECTCOMPATVERSION` (introduced in v11) is accepted.
  • Loading branch information
tim-weis committed Dec 19, 2024
1 parent 81086b0 commit 41290a1
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ fn proj_info_opt_records() {
\x00\x00\x00\x00";
let res = parse_project_information(INPUT_NONE_NONE);
assert!(res.is_ok());
let res = res.unwrap();
assert!(res.1.information.constants.is_none());

const INPUT_NONE_SOME: &[u8] = b"\x01\x00\x04\x00\x00\x00\x02\x00\x00\x00\
\x02\x00\x04\x00\x00\x00\x09\x04\x00\x00\
Expand All @@ -85,4 +87,43 @@ fn proj_info_opt_records() {
\x00\x00\x00\x00";
let res = parse_project_information(INPUT_NONE_SOME);
assert!(res.is_ok());
let res = res.unwrap();
assert!(res.1.information.constants.is_some());

const INPUT_SOME_NONE: &[u8] = b"\x01\x00\x04\x00\x00\x00\x02\x00\x00\x00\
\x4A\x00\x04\x00\x00\x00\x01\x02\x03\x04\
\x02\x00\x04\x00\x00\x00\x09\x04\x00\x00\
\x14\x00\x04\x00\x00\x00\x09\x04\x00\x00\
\x03\x00\x02\x00\x00\x00\xE4\x04\
\x04\x00\x01\x00\x00\x00\x41\
\x05\x00\x01\x00\x00\x00\x41\x40\x00\x02\x00\x00\x00\x41\x00\
\x06\x00\x00\x00\x00\x00\x3D\x00\x00\x00\x00\x00\
\x07\x00\x04\x00\x00\x00\x00\x00\x00\x00\
\x08\x00\x04\x00\x00\x00\x00\x00\x00\x00\
\x09\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\
\x0F\x00\x02\x00\x00\x00\x00\x00\
\x13\x00\x02\x00\x00\x00\xFF\xFF\
\x10\x00\
\x00\x00\x00\x00";
let res = parse_project_information(INPUT_SOME_NONE);
assert!(res.is_ok());

const INPUT_SOME_SOME: &[u8] = b"\x01\x00\x04\x00\x00\x00\x02\x00\x00\x00\
\x4A\x00\x04\x00\x00\x00\x01\x02\x03\x04\
\x02\x00\x04\x00\x00\x00\x09\x04\x00\x00\
\x14\x00\x04\x00\x00\x00\x09\x04\x00\x00\
\x03\x00\x02\x00\x00\x00\xE4\x04\
\x04\x00\x01\x00\x00\x00\x41\
\x05\x00\x01\x00\x00\x00\x41\x40\x00\x02\x00\x00\x00\x41\x00\
\x06\x00\x00\x00\x00\x00\x3D\x00\x00\x00\x00\x00\
\x07\x00\x04\x00\x00\x00\x00\x00\x00\x00\
\x08\x00\x04\x00\x00\x00\x00\x00\x00\x00\
\x09\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\
\x0C\x00\x00\x00\x00\x00\x3C\x00\x00\x00\x00\x00\
\x0F\x00\x02\x00\x00\x00\x00\x00\
\x13\x00\x02\x00\x00\x00\xFF\xFF\
\x10\x00\
\x00\x00\x00\x00";
let res = parse_project_information(INPUT_SOME_SOME);
assert!(res.is_ok());
}

0 comments on commit 41290a1

Please sign in to comment.