From bfe679dfc8fff976078a20f984aa6ab8c0cb3e66 Mon Sep 17 00:00:00 2001 From: Max Bradbury Date: Tue, 14 Apr 2020 00:17:40 +0100 Subject: [PATCH] move test resources --- .gitignore | 3 ++- src/avatar.rs | 4 ++-- src/ending.rs | 2 +- src/game.rs | 4 ++-- src/image.rs | 4 ++-- src/item.rs | 4 ++-- src/room.rs | 4 ++-- src/sprite.rs | 4 ++-- {test/resources => src/test-resources}/avatar | 0 {test/resources => src/test-resources}/default.bitsy | 0 {test/resources => src/test-resources}/ending | 0 {test/resources => src/test-resources}/example.bitsy | 0 {test/resources => src/test-resources}/image | 0 {test/resources => src/test-resources}/image-chequers-1 | 0 {test/resources => src/test-resources}/item | 0 {test/resources => src/test-resources}/room | 0 {test/resources => src/test-resources}/sprite | 0 {test/resources => src/test-resources}/tile | 0 {test/resources => src/test-resources}/tile-chequers | 0 src/tile.rs | 4 ++-- 20 files changed, 17 insertions(+), 16 deletions(-) rename {test/resources => src/test-resources}/avatar (100%) rename {test/resources => src/test-resources}/default.bitsy (100%) rename {test/resources => src/test-resources}/ending (100%) rename {test/resources => src/test-resources}/example.bitsy (100%) rename {test/resources => src/test-resources}/image (100%) rename {test/resources => src/test-resources}/image-chequers-1 (100%) rename {test/resources => src/test-resources}/item (100%) rename {test/resources => src/test-resources}/room (100%) rename {test/resources => src/test-resources}/sprite (100%) rename {test/resources => src/test-resources}/tile (100%) rename {test/resources => src/test-resources}/tile-chequers (100%) diff --git a/.gitignore b/.gitignore index f731584..d992157 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ /target /Cargo.lock /.idea/ -/test/resources/bitsy-archive/ +/src/test-resources/ +/src/test-resources/omnibus/ diff --git a/src/avatar.rs b/src/avatar.rs index eb2c3d5..1b96a76 100644 --- a/src/avatar.rs +++ b/src/avatar.rs @@ -41,7 +41,7 @@ impl ToString for Avatar { #[test] fn test_avatar_from_string() { let output = Avatar::from( - include_str!("../test/resources/avatar").to_string() + include_str!("test-resources/avatar").to_string() ); assert_eq!(output, mock::avatar()); @@ -49,5 +49,5 @@ fn test_avatar_from_string() { #[test] fn test_avatar_to_string() { - assert_eq!(mock::avatar().to_string(), include_str!("../test/resources/avatar")); + assert_eq!(mock::avatar().to_string(), include_str!("test-resources/avatar")); } diff --git a/src/ending.rs b/src/ending.rs index 3696bcd..8a65e29 100644 --- a/src/ending.rs +++ b/src/ending.rs @@ -26,7 +26,7 @@ impl ToString for Ending { #[test] fn test_ending_from_string() { assert_eq!( - Ending::from(include_str!("../test/resources/ending").to_string()), + Ending::from(include_str!("test-resources/ending").to_string()), Ending { id: "a".to_string(), dialogue: "This is a long line of dialogue. Blah blah blah".to_string() diff --git a/src/game.rs b/src/game.rs index 1a8b367..aed95ba 100644 --- a/src/game.rs +++ b/src/game.rs @@ -199,7 +199,7 @@ impl Game { #[test] fn test_game_from_string() { let output = Game::from( - include_str!["../test/resources/default.bitsy"].to_string() + include_str!["test-resources/default.bitsy"].to_string() ); let expected = mock::game_default(); @@ -210,7 +210,7 @@ fn test_game_from_string() { #[test] fn test_game_to_string() { let output = mock::game_default().to_string(); - let expected = include_str!["../test/resources/default.bitsy"].to_string(); + let expected = include_str!["test-resources/default.bitsy"].to_string(); assert_eq!(output, expected); } diff --git a/src/image.rs b/src/image.rs index f64ea52..0f88b25 100644 --- a/src/image.rs +++ b/src/image.rs @@ -41,7 +41,7 @@ impl ToString for Image { #[test] fn test_image_from_string() { - let output = Image::from(include_str!("../test/resources/image").to_string()); + let output = Image::from(include_str!("test-resources/image").to_string()); let expected = Image { pixels: vec![ @@ -62,6 +62,6 @@ fn test_image_from_string() { #[test] fn test_image_to_string() { let output = mock::image::chequers_1().to_string(); - let expected = include_str!("../test/resources/image-chequers-1").to_string(); + let expected = include_str!("test-resources/image-chequers-1").to_string(); assert_eq!(output, expected); } diff --git a/src/item.rs b/src/item.rs index 940eaf5..1532760 100644 --- a/src/item.rs +++ b/src/item.rs @@ -64,7 +64,7 @@ impl ToString for Item { #[test] fn test_item_from_string() { - let output = Item::from(include_str!("../test/resources/item").to_string()); + let output = Item::from(include_str!("test-resources/item").to_string()); let expected = mock::item(); assert_eq!(output, expected); } @@ -72,6 +72,6 @@ fn test_item_from_string() { #[test] fn test_item_to_string() { let output = mock::item().to_string(); - let expected = include_str!("../test/resources/item").to_string(); + let expected = include_str!("test-resources/item").to_string(); assert_eq!(output, expected); } diff --git a/src/room.rs b/src/room.rs index 0c63e0e..ae78ca0 100644 --- a/src/room.rs +++ b/src/room.rs @@ -87,7 +87,7 @@ impl From for Room { #[test] fn test_room_from_string() { assert_eq!( - Room::from(include_str!("../test/resources/room").to_string()), + Room::from(include_str!("test-resources/room").to_string()), mock::room() ); } @@ -146,5 +146,5 @@ impl ToString for Room { #[test] fn test_room_to_string() { - assert_eq!(mock::room().to_string(), include_str!("../test/resources/room").to_string()); + assert_eq!(mock::room().to_string(), include_str!("test-resources/room").to_string()); } diff --git a/src/sprite.rs b/src/sprite.rs index 19cd59c..ca0c136 100644 --- a/src/sprite.rs +++ b/src/sprite.rs @@ -80,7 +80,7 @@ impl ToString for Sprite { #[test] fn test_sprite_from_string() { let output = Sprite::from( - include_str!("../test/resources/sprite").to_string() + include_str!("test-resources/sprite").to_string() ); let expected = mock::sprite(); @@ -90,5 +90,5 @@ fn test_sprite_from_string() { #[test] fn test_sprite_to_string() { - assert_eq!(mock::sprite().to_string(), include_str!("../test/resources/sprite").to_string()); + assert_eq!(mock::sprite().to_string(), include_str!("test-resources/sprite").to_string()); } diff --git a/test/resources/avatar b/src/test-resources/avatar similarity index 100% rename from test/resources/avatar rename to src/test-resources/avatar diff --git a/test/resources/default.bitsy b/src/test-resources/default.bitsy similarity index 100% rename from test/resources/default.bitsy rename to src/test-resources/default.bitsy diff --git a/test/resources/ending b/src/test-resources/ending similarity index 100% rename from test/resources/ending rename to src/test-resources/ending diff --git a/test/resources/example.bitsy b/src/test-resources/example.bitsy similarity index 100% rename from test/resources/example.bitsy rename to src/test-resources/example.bitsy diff --git a/test/resources/image b/src/test-resources/image similarity index 100% rename from test/resources/image rename to src/test-resources/image diff --git a/test/resources/image-chequers-1 b/src/test-resources/image-chequers-1 similarity index 100% rename from test/resources/image-chequers-1 rename to src/test-resources/image-chequers-1 diff --git a/test/resources/item b/src/test-resources/item similarity index 100% rename from test/resources/item rename to src/test-resources/item diff --git a/test/resources/room b/src/test-resources/room similarity index 100% rename from test/resources/room rename to src/test-resources/room diff --git a/test/resources/sprite b/src/test-resources/sprite similarity index 100% rename from test/resources/sprite rename to src/test-resources/sprite diff --git a/test/resources/tile b/src/test-resources/tile similarity index 100% rename from test/resources/tile rename to src/test-resources/tile diff --git a/test/resources/tile-chequers b/src/test-resources/tile-chequers similarity index 100% rename from test/resources/tile-chequers rename to src/test-resources/tile-chequers diff --git a/src/tile.rs b/src/tile.rs index a34aed3..63e80d0 100644 --- a/src/tile.rs +++ b/src/tile.rs @@ -66,7 +66,7 @@ impl ToString for Tile { #[test] fn test_tile_from_string() { - let output = Tile::from(include_str!("../test/resources/tile").to_string()); + let output = Tile::from(include_str!("test-resources/tile").to_string()); let expected = Tile { id: 35, @@ -94,7 +94,7 @@ fn test_tile_to_string() { ] }.to_string(); - let expected = include_str!("../test/resources/tile-chequers").to_string(); + let expected = include_str!("test-resources/tile-chequers").to_string(); assert_eq!(output, expected); }