From e1bf7cbae4da398737493dc9cd8883e3d14ca814 Mon Sep 17 00:00:00 2001 From: Max Bradbury Date: Sat, 18 Apr 2020 12:45:43 +0100 Subject: [PATCH] test RTL and font options --- src/game.rs | 7 ++ src/test-resources/arabic.bitsy | 110 ++++++++++++++++++++++++++++++++ 2 files changed, 117 insertions(+) create mode 100644 src/test-resources/arabic.bitsy diff --git a/src/game.rs b/src/game.rs index 6e36adc..fe06cef 100644 --- a/src/game.rs +++ b/src/game.rs @@ -368,3 +368,10 @@ fn test_bitsy_omnibus() { println!("Success! {} passes, {} skips.", passes, skips); } } + +#[test] +fn test_arabic() { + let game = Game::from(include_str!("test-resources/arabic.bitsy").to_string()); + assert_eq!(game.font, Font::Arabic); + assert_eq!(game.text_direction, TextDirection::RightToLeft); +} diff --git a/src/test-resources/arabic.bitsy b/src/test-resources/arabic.bitsy new file mode 100644 index 0000000..33e3fc1 --- /dev/null +++ b/src/test-resources/arabic.bitsy @@ -0,0 +1,110 @@ + + +# BITSY VERSION 7.0 + +! ROOM_FORMAT 1 + +DEFAULT_FONT arabic + +TEXT_DIRECTION RTL + +PAL 0 +NAME blueprint +0,82,204 +128,159,255 +255,255,255 + +ROOM 0 +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0,a,a,a,a,a,a,a,a,a,a,a,a,a,a,0 +0,a,0,0,0,0,0,0,0,0,0,0,0,0,a,0 +0,a,0,0,0,0,0,0,0,0,0,0,0,0,a,0 +0,a,0,0,0,0,0,0,0,0,0,0,0,0,a,0 +0,a,0,0,0,0,0,0,0,0,0,0,0,0,a,0 +0,a,0,0,0,0,0,0,0,0,0,0,0,0,a,0 +0,a,0,0,0,0,0,0,0,0,0,0,0,0,a,0 +0,a,0,0,0,0,0,0,0,0,0,0,0,0,a,0 +0,a,0,0,0,0,0,0,0,0,0,0,0,0,a,0 +0,a,0,0,0,0,0,0,0,0,0,0,0,0,a,0 +0,a,0,0,0,0,0,0,0,0,0,0,0,0,a,0 +0,a,0,0,0,0,0,0,0,0,0,0,0,0,a,0 +0,a,0,0,0,0,0,0,0,0,0,0,0,0,a,0 +0,a,a,a,a,a,a,a,a,a,a,a,a,a,a,0 +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +NAME example room +PAL 0 + +TIL a +11111111 +10000001 +10000001 +10011001 +10011001 +10000001 +10000001 +11111111 +NAME block + +SPR A +00011000 +00011000 +00011000 +00111100 +01111110 +10111101 +00100100 +00100100 +POS 0 4,4 + +SPR a +00000000 +00000000 +01010001 +01110001 +01110010 +01111100 +00111100 +00100100 +NAME cat +DLG 0 +POS 0 8,12 + +ITM 0 +00000000 +00000000 +00000000 +00111100 +01100100 +00100100 +00011000 +00000000 +NAME tea +DLG 1 + +ITM 1 +00000000 +00111100 +00100100 +00111100 +00010000 +00011000 +00010000 +00011000 +NAME key +DLG 2 + +DLG 0 +I'm a cat +NAME cat dialog + +DLG 1 +You found a nice warm cup of tea +NAME tea dialog + +DLG 2 +A key! {wvy}What does it open?{wvy} +NAME key dialog + +VAR a +42 +