From cf8389ddd8d58ee17331fc0ce137f931af6ac1b4 Mon Sep 17 00:00:00 2001 From: Max Bradbury Date: Sat, 18 Apr 2020 12:49:51 +0100 Subject: [PATCH] game version handling done --- README.md | 1 - src/game.rs | 7 +++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 22a1dcb..d926f86 100644 --- a/README.md +++ b/README.md @@ -58,7 +58,6 @@ some more practical uses would be things like: (avatar seems to be somewhere in the sprites, after any numeric-ID sprites and before any alphabetic-ID sprites...) * check multi-line endings/dialogues -* bitsy_version 5.0 is rendered as "5" ### tidy up diff --git a/src/game.rs b/src/game.rs index 3315b7a..60cdfb8 100644 --- a/src/game.rs +++ b/src/game.rs @@ -393,3 +393,10 @@ fn test_arabic() { assert_eq!(game.font, Font::Arabic); assert_eq!(game.text_direction, TextDirection::RightToLeft); } + +#[test] +fn test_version_formatting() { + let mut game = crate::mock::game_default(); + game.version = Version { major: 5, minor: 0 }; + assert!(game.to_string().contains("# BITSY VERSION 5.0")) +}