WIP - fix Rust unit tests

grdddj/R_debug_font_screen
grdddj 1 year ago
parent e4e3d92b97
commit bd2fc33dfe

@ -447,7 +447,7 @@ mod tests {
page.place(SCREEN);
let expected =
"<SwipePage active_page:0 page_count:1 content:<Paragraphs > buttons:<Empty > >";
"<SwipePage active_page::0,page_count::1,content:<Paragraphs **CONTENT** **CONTENT** > buttons:<Empty > >";
assert_eq!(trace(&page), expected);
swipe_up(&mut page);
@ -474,7 +474,7 @@ mod tests {
);
page.place(SCREEN);
let expected = "<SwipePage active_page:0 page_count:1 content:<Paragraphs This is the first paragraph\nand it should fit on the\nscreen entirely.\nSecond, bold, paragraph\nshould also fit on the\nscreen whole I think.\n> buttons:<Empty > >";
let expected = "<SwipePage active_page::0,page_count::1,content:<Paragraphs **CONTENT** This is the first paragraph\nand it should fit on the\nscreen entirely.\nSecond, bold, paragraph\nshould also fit on the\nscreen whole I think.\n **CONTENT** > buttons:<Empty > >";
assert_eq!(trace(&page), expected);
swipe_up(&mut page);
@ -497,8 +497,8 @@ mod tests {
);
page.place(SCREEN);
let expected1 = "<SwipePage active_page:0 page_count:2 content:<Paragraphs This is somewhat long\nparagraph that goes on\nand on and on and on\nand on and will definitely\nnot fit on just a single\nscreen. You have to\nswipe a bit to see all the\ntext it contains I guess....\n> buttons:<FixedHeightBar inner:<Button text:NO > > >";
let expected2 = "<SwipePage active_page:1 page_count:2 content:<Paragraphs There's just so much\nletters in it.\n> buttons:<FixedHeightBar inner:<Button text:NO > > >";
let expected1 = "<SwipePage active_page::0,page_count::2,content:<Paragraphs **CONTENT** This is somewhat long\nparagraph that goes on\nand on and on and on\nand on and will definitely\nnot fit on just a single\nscreen. You have to\nswipe a bit to see all the\ntext it contains I guess....\n **CONTENT** > buttons:<FixedHeightBar inner:<Button text:NO > > >";
let expected2 = "<SwipePage active_page::1,page_count::2,content:<Paragraphs **CONTENT** There's just so much\nletters in it.\n **CONTENT** > buttons:<FixedHeightBar inner:<Button text:NO > > >";
assert_eq!(trace(&page), expected1);
swipe_down(&mut page);
@ -533,9 +533,9 @@ mod tests {
);
page.place(SCREEN);
let expected1 = "<SwipePage active_page:0 page_count:3 content:<Paragraphs This paragraph is using a\nbold font. It doesn't\nneed to be all that long.\nAnd this one is\nusing MONO. Mono\nspace is nice fo\nr numbers, they\n> buttons:<FixedHeightBar inner:<Button text:IDK > > >";
let expected2 = "<SwipePage active_page:1 page_count:3 content:<Paragraphs have the same wi\ndth and can be s\ncanned quickly.\nEven if they spa\nn several pages\nor something.\nLet's add another one...\n> buttons:<FixedHeightBar inner:<Button text:IDK > > >";
let expected3 = "<SwipePage active_page:2 page_count:3 content:<Paragraphs for a good measure. This\none should overflow all\nthe way to the third\npage with a bit of luck.\n> buttons:<FixedHeightBar inner:<Button text:IDK > > >";
let expected1 = "<SwipePage active_page::0,page_count::3,content:<Paragraphs **CONTENT** This paragraph is using a\nbold font. It doesn't\nneed to be all that long.\nAnd this one is\nusing MONO. Mono\nspace is nice fo\nr numbers, they\n **CONTENT** > buttons:<FixedHeightBar inner:<Button text:IDK > > >";
let expected2 = "<SwipePage active_page::1,page_count::3,content:<Paragraphs **CONTENT** have the same wi\ndth and can be s\ncanned quickly.\nEven if they spa\nn several pages\nor something.\nLet's add another one...\n **CONTENT** > buttons:<FixedHeightBar inner:<Button text:IDK > > >";
let expected3 = "<SwipePage active_page::2,page_count::3,content:<Paragraphs **CONTENT** for a good measure. This\none should overflow all\nthe way to the third\npage with a bit of luck.\n **CONTENT** > buttons:<FixedHeightBar inner:<Button text:IDK > > >";
assert_eq!(trace(&page), expected1);
swipe_down(&mut page);
@ -567,9 +567,9 @@ mod tests {
);
page.place(SCREEN);
let expected1 = "<SwipePage active_page:0 page_count:3 content:<Paragraphs Short one.\n> buttons:<FixedHeightBar inner:<Empty > > >";
let expected2 = "<SwipePage active_page:1 page_count:3 content:<Paragraphs Short two.\n> buttons:<FixedHeightBar inner:<Empty > > >";
let expected3 = "<SwipePage active_page:2 page_count:3 content:<Paragraphs Short three.\n> buttons:<FixedHeightBar inner:<Empty > > >";
let expected1 = "<SwipePage active_page::0,page_count::3,content:<Paragraphs **CONTENT** Short one.\n **CONTENT** > buttons:<FixedHeightBar inner:<Empty > > >";
let expected2 = "<SwipePage active_page::1,page_count::3,content:<Paragraphs **CONTENT** Short two.\n **CONTENT** > buttons:<FixedHeightBar inner:<Empty > > >";
let expected3 = "<SwipePage active_page::2,page_count::3,content:<Paragraphs **CONTENT** Short three.\n **CONTENT** > buttons:<FixedHeightBar inner:<Empty > > >";
assert_eq!(trace(&page), expected1);
swipe_up(&mut page);

Loading…
Cancel
Save