mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-12-06 14:03:16 -05:00
Tests: cover script DOM range checks, PrintOptions groups and evalFile refusals
- The text attribute test has rows one step past the bounds of baselineShift, horizontalScale, verticalScale and rotation. - A new print test prints each PrintOptions group (overprints, page marks, orientation, separations, custom and transverse paper, emulsion, negative and position) through Document.print and compares the PostScript with what file.print writes for the matching settings, leaving out the CreationDate comment. Each case also checks that its settings change the file. The color intent is compared in PDF, by the art the printed file opens as. - A new include test reads a refused absolute path whose URI-decoded form is not read either, and checks that $.evalFile keeps the refusal.
This commit is contained in:
1 parent
15cc3b048f
commit
b32285d451
3 files changed
+107
No files matched your search
@@ -461,6 +461,21 @@ fn script_eval_file_outside_scope_refused() {
|
||||
let _ = std::fs::remove_dir_all(base);
|
||||
}
|
||||
|
||||
/// A refused absolute path whose URI form is read by no candidate either keeps the refusal of
|
||||
/// the path as written, not a missing file.
|
||||
#[cfg(not(windows))]
|
||||
#[test]
|
||||
fn script_eval_file_keeps_the_refusal_when_no_uri_form_is_read() {
|
||||
let base = folder("evaluri");
|
||||
write(&base.join("out%20side.jsx"), "1;");
|
||||
let absolute = base.join("out%20side.jsx").to_string_lossy().into_owned();
|
||||
let script = format!("try {{ $.evalFile('{absolute}'); }} catch (e) {{ vc.log(String(e)); }}");
|
||||
let r = run(&base, &script).unwrap();
|
||||
let e = r["log"][0].as_str().unwrap_or_default().to_string();
|
||||
assert!(e.starts_with(&format!("Error: script file read refused: {absolute}")), "{e}");
|
||||
let _ = std::fs::remove_dir_all(base);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn script_directives_in_strings_and_block_comments_are_inert() {
|
||||
let mut s = Session::new();
|
||||
|
||||
Reference in new issue
Block a user