Skip to content

Commit 5a76481

Browse files
committed
Fix test compilation after last commit.
1 parent 805ed88 commit 5a76481

File tree

6 files changed

+14
-15
lines changed

6 files changed

+14
-15
lines changed

Diff for: src/websocket/types/room/objects/container.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,9 @@ mod test {
8484
x: 19,
8585
y: 22,
8686
ref id,
87+
ref store,
8788
..
88-
} if id == "58cc8143050a8f701678f22e" && store == store! {energy: 2000} => (),
89+
} if id == "58cc8143050a8f701678f22e" && *store == store! {Energy: 2000} => (),
8990
other => panic!(
9091
"expected pre-set StructureContainer to match, found {:#?}",
9192
other

Diff for: src/websocket/types/room/objects/creep.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ mod test {
180180

181181
use crate::data::RoomName;
182182

183-
use super::{Creep, CreepActions, CreepPartType};
183+
use super::{ActionLogTarget, Creep, CreepActions, CreepPartType};
184184

185185
#[test]
186186
fn parse_creep() {
@@ -269,7 +269,7 @@ mod test {
269269
repair: None,
270270
reserve_controller: None,
271271
say: None,
272-
upgrade_controller: ActionLogTarget { x: 27, y: 8 },
272+
upgrade_controller: Some(ActionLogTarget { x: 27, y: 8 }),
273273
},
274274
ref body,
275275
ref user,

Diff for: src/websocket/types/room/objects/storage.rs

+6-8
Original file line numberDiff line numberDiff line change
@@ -88,21 +88,19 @@ mod test {
8888

8989
match obj {
9090
StructureStorage {
91-
ghodium_oxide: 0,
92-
keanium_oxide: 0,
93-
oxygen: 0,
94-
utrium: 33581,
95-
catalyzed_ghodium_alkalide: 5400,
96-
keanium: 0,
97-
energy: 631112,
9891
capacity: 1000000,
9992
hits: 10000,
10093
hits_max: 10000,
10194
notify_when_attacked: true,
10295
x: 7,
10396
y: 16,
97+
ref store,
10498
..
105-
} => (),
99+
} if *store
100+
== store! { Energy: 631112, Utrium: 33581, CatalyzedGhodiumAlkalide: 5400 } =>
101+
{
102+
()
103+
}
106104
other => panic!(
107105
"expected pre-set StructureStorage to match, found {:#?}",
108106
other

Diff for: src/websocket/types/room/objects/terminal.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ mod test {
104104
..
105105
} if user == "57874d42d0ae911e3bd15bbc"
106106
&& id == "59675fbfb554456b195342e7"
107-
&& store == store! {energy: 1321} =>
107+
&& *store == store! {Energy: 1321} =>
108108
{
109109
()
110110
}

Diff for: src/websocket/types/room/objects/tombstone.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ impl Tombstone {
4949
mod test {
5050
use serde::Deserialize;
5151

52-
use super::Tombstone;
52+
use super::{ResourceType, Tombstone};
5353

5454
#[test]
5555
fn parse_simple_tombstone() {
@@ -119,6 +119,6 @@ mod test {
119119

120120
assert_eq!(obj.creep_id, "5ce098c5c4e055067fbf182e");
121121
assert_eq!(obj.creep_name, "6922398-0");
122-
assert_eq!(obj.energy, 44);
122+
assert_eq!(obj.store.get(ResourceType::Energy), 44);
123123
}
124124
}

Diff for: src/websocket/types/room/resources.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ macro_rules! store {
262262
let mut store = crate::websocket::types::room::resources::Store::default();
263263

264264
$(
265-
store.0.insert(stringify!($name).to_owned(), $val);
265+
store.0.insert(crate::websocket::types::room::resources::ResourceType::$name, $val);
266266
)*
267267

268268
store

0 commit comments

Comments
 (0)