move test resources

This commit is contained in:
2020-04-14 00:17:40 +01:00
parent 799a97c4dd
commit bfe679dfc8
20 changed files with 17 additions and 16 deletions

View File

@@ -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"));
}

View File

@@ -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()

View File

@@ -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);
}

View File

@@ -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);
}

View File

@@ -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);
}

View File

@@ -87,7 +87,7 @@ impl From<String> 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());
}

View File

@@ -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());
}

19
src/test-resources/avatar Normal file
View File

@@ -0,0 +1,19 @@
SPR A
00000000
00111100
01111110
11101110
10011001
11111111
11111111
01111110
>
00000000
00000000
00111100
01111110
11101110
10011001
11111111
01110110
POS 0 2,5

View File

@@ -0,0 +1,84 @@
Write your game's title here
# BITSY VERSION 6.5
! ROOM_FORMAT 1
PAL 0
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
PAL 0
TIL a
11111111
10000001
10000001
10011001
10011001
10000001
10000001
11111111
SPR A
00011000
00011000
00011000
00111100
01111110
10111101
00100100
00100100
POS 0 4,4
SPR a
00000000
00000000
01010001
01110001
01110010
01111100
00111100
00100100
DLG SPR_0
POS 0 8,12
ITM 0
00000000
00000000
00000000
00111100
01100100
00100100
00011000
00000000
NAME tea
DLG ITM_0
DLG SPR_0
I'm a cat
DLG ITM_0
You found a nice warm cup of tea
VAR a
42

View File

@@ -0,0 +1,2 @@
END a
This is a long line of dialogue. Blah blah blah

1492
src/test-resources/example.bitsy Executable file

File diff suppressed because it is too large Load Diff

8
src/test-resources/image Normal file
View File

@@ -0,0 +1,8 @@
11111111
11001111
10111111
11111111
11111111
11111111
11111111
11111111

View File

@@ -0,0 +1,8 @@
10101010
01010101
10101010
01010101
10101010
01010101
10101010
01010101

11
src/test-resources/item Normal file
View File

@@ -0,0 +1,11 @@
ITM 6
01000000
00000000
00000000
00000100
00100000
00000000
00000000
00000010
NAME door
DLG ITM_2

26
src/test-resources/room Normal file
View File

@@ -0,0 +1,26 @@
ROOM a
0,0,0,0,0,0,0,0,1l,0,0,0,0,0,0,0
y,x,0,0,1j,0,0,1j,1l,0,1j,0,0,1j,0,0
y,y,x,k,k,1c,1x,1y,1m,0,0,0,0,0,0,0
y,y,y,x,k,s,s,s,k,k,k,k,k,1g,1f,k
k,z,z,z,1i,1u,1u,1u,1v,11,19,1b,1a,1e,10,k
k,z,z,11,12,z,z,z,z,10,17,z,18,1e,12,k
k,z,z,z,z,z,z,z,z,1k,14,15,16,1h,z,k
k,z,z,z,z,z,z,10,1d,1v,1r,1s,1r,1q,1z,k
k,z,z,12,10,z,z,z,1i,1n,1o,1o,1o,1p,z,k
k,z,z,z,z,z,z,z,z,z,z,z,10,z,z,k
k,z,z,z,z,z,11,z,z,z,z,z,z,z,z,k
k,z,z,z,z,z,z,z,z,z,12,z,z,10,12,k
k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
NAME cellar 7
ITM d 11,5
ITM e 8,3
ITM 5 1,0
ITM 6 2,1
ITM 6 3,2
EXT 3,3 3 10,6
END undefined 8,7
PAL 9

12
src/test-resources/sprite Normal file
View File

@@ -0,0 +1,12 @@
SPR a
00000000
01111000
01001000
00111100
00111100
01011110
01011110
01101111
NAME hatch
DLG SPR_0
POS 4 9,7

11
src/test-resources/tile Normal file
View File

@@ -0,0 +1,11 @@
TIL z
11111111
11111111
11111111
11111111
11111111
11111111
11111111
11111111
NAME concrete 1
WAL true

View File

@@ -0,0 +1,19 @@
TIL 7a
10101010
01010101
10101010
01010101
10101010
01010101
10101010
01010101
>
01010101
10101010
01010101
10101010
01010101
10101010
01010101
10101010
NAME chequers

View File

@@ -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);
}