refactor: drop the original German/English quotes
Only the English quotes remain. Adapt the caption test to quotes of any line count and check that the list wraps round. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit was merged in pull request #3.
This commit is contained in:
@@ -24,8 +24,9 @@
|
||||
//! band and are not stored by the printer (no memory switch writes).
|
||||
//!
|
||||
//! Each photo is captioned with the event name and place above it, and a
|
||||
//! keepsake line, the capture date and time and one of `QUOTES` below it, in
|
||||
//! German with the English directly underneath. The timestamp is the system
|
||||
//! keepsake line, the capture date and time and one of `QUOTES` below it. The
|
||||
//! captions are in German with the English directly underneath, the quotes in
|
||||
//! English only. The timestamp is the system
|
||||
//! clock in local time, so the booth's clock has to be right for it to mean
|
||||
//! anything. Text goes out in the printer's own code page (PC437), since it
|
||||
//! prints UTF-8 bytes as separate glyphs; see `code_page`.
|
||||
@@ -619,16 +620,16 @@ mod tests {
|
||||
width_bytes: 1,
|
||||
data: vec![0; 1],
|
||||
};
|
||||
let job = encode(&bitmap, &Head::default(), 2, STAMP, 6);
|
||||
let last = QUOTES.len() - 1;
|
||||
let job = encode(&bitmap, &Head::default(), 2, STAMP, last);
|
||||
assert!(contains_line(&job[0], EVENT_TITLE) && contains_line(&job[0], EVENT_PLACE));
|
||||
assert!(contains_line(&job[2], KEEPSAKE_DE) && contains_line(&job[2], KEEPSAKE_EN));
|
||||
assert!(contains_line(&job[2], STAMP));
|
||||
// Consecutive copies get consecutive quotes, wrapping round the list.
|
||||
assert!(contains_line(&job[2], QUOTES[6][0]) && contains_line(&job[2], QUOTES[6][1]));
|
||||
assert!(contains_line(&job[5], QUOTES[7][0]) && contains_line(&job[5], QUOTES[7][1]));
|
||||
assert!(QUOTES[last].iter().all(|line| contains_line(&job[2], line)));
|
||||
assert!(QUOTES[0].iter().all(|line| contains_line(&job[5], line)));
|
||||
assert!(
|
||||
encode(&bitmap, &Head::default(), 1, STAMP, QUOTES.len() - 1)[2]
|
||||
.ends_with(&footer(&Head::default(), STAMP, "ES[QUOTES.len() - 1])[1..])
|
||||
job[2].ends_with(&footer(&Head::default(), STAMP, QUOTES[last])[1..])
|
||||
);
|
||||
// The real stamp is as wide as the one used here.
|
||||
let now = Local::now().format(STAMP_FORMAT).to_string();
|
||||
|
||||
Reference in New Issue
Block a user