Skip to content

Commit

Permalink
[basm] improve a est related to ascii amsdos
Browse files Browse the repository at this point in the history
  • Loading branch information
Krusty/Benediction committed Nov 11, 2024
1 parent 8a4405f commit e2d4248
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion cpclib-basm/tests/basm_save.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,29 @@ fn test_save_ascii() {
let args = args_parser.get_matches_from(["basm", "-I", ".", "-I", "tests/asm/", "good_save_ascii.asm", "--override"]);
let (env, _) = process(&args, Rc::new(())).expect("Unable to assemble the file");

let expected = b"HELLO WORLD";

let (content, header) = load_file("TESTASCII.DSK#HELLO.TXT", &ParserOptions::default()).unwrap();
assert!(header.is_none(), "ASCII files have no header");
let content: Vec<u8> = content.into();
let expected = b"HELLO WORLD";
assert_eq!(
&content[..expected.len()],
expected
);
assert_eq!(content.len(), 1024); // XXX sadly ASCII mode does not allow to properly know the size
// XXX no idea if 1024 is the real size used in real cpc


let (content, header) = load_file("TESTASCII.DSK#HELLO.BIN", &ParserOptions::default()).unwrap();
assert!(header.is_some());
let content: Vec<u8> = content.into();
assert_eq!(
&content[..expected.len()],
expected
);
assert_eq!(content.len(), expected.len());


}

#[test]
Expand Down

0 comments on commit e2d4248

Please sign in to comment.