Skip to content

Commit 70c0226

Browse files
committed
Update tests to compile and remove warnings.
1 parent 3909ac4 commit 70c0226

File tree

5 files changed

+16
-56
lines changed

5 files changed

+16
-56
lines changed

crate/workspace_tests/src/application_robot/state/robot_state.rs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,6 @@ mod test {
271271
setup(invocations, intercepts)
272272
}
273273

274-
#[macro_use]
275274
macro_rules! delegate_test {
276275
($test_name:ident, $function:ident, $invocation:expr) => {
277276
#[test]
@@ -286,7 +285,6 @@ mod test {
286285
};
287286
}
288287

289-
#[macro_use]
290288
macro_rules! intercept_no_op_test {
291289
($test_name:ident, $function:ident, $($invocation:expr),* $(,)*) => {
292290
#[test]
@@ -304,7 +302,6 @@ mod test {
304302
}
305303
}
306304

307-
#[macro_use]
308305
macro_rules! intercept_no_op_trans_test {
309306
($test_name:ident, $function:ident, $expected_trans:expr, $($invocation:expr),* $(,)*) => {
310307
#[test]
@@ -323,7 +320,6 @@ mod test {
323320
}
324321
}
325322

326-
#[macro_use]
327323
macro_rules! intercept_begin_test {
328324
($test_name:ident, $function:ident, $expected_trans:expr, $($invocation:expr),* $(,)*) => {
329325
#[test]
@@ -342,7 +338,6 @@ mod test {
342338
}
343339
}
344340

345-
#[macro_use]
346341
macro_rules! intercept_end_test {
347342
($test_name:ident, $function:ident, $expected_trans:expr, $($invocation:expr),* $(,)*) => {
348343
#[test]
@@ -702,7 +697,6 @@ mod test {
702697

703698
/// Declares a function that pushes the specified invocation to the
704699
/// `self.invocations` field.
705-
#[macro_use]
706700
macro_rules! fn_ {
707701
($function:ident, $invocation:expr) => {
708702
fn $function(&mut self, _: StateData<'_, T>) {
@@ -716,7 +710,6 @@ mod test {
716710
///
717711
/// This macro passes the `self.id` field as a parameter to the `Invocation`
718712
/// variant.
719-
#[macro_use]
720713
macro_rules! fn_id {
721714
($function:ident, $invocation:expr; [$($additional_param:ty),*]) => {
722715
fn $function(&mut self, $(_: $additional_param),*) {
@@ -732,7 +725,6 @@ mod test {
732725
///
733726
/// The function returns the value in the `self.trans` field, which is
734727
/// expected to contain a value.
735-
#[macro_use]
736728
macro_rules! fn_trans {
737729
($function:ident, $invocation:expr; [$($additional_param:ty),*]) => {
738730
fn $function(&mut self, $(_: $additional_param),*) -> Trans<T, E> {
@@ -749,7 +741,6 @@ mod test {
749741
/// `self.invocations` field.
750742
///
751743
/// The function returns the optional value in the `self.$trans` field
752-
#[macro_use]
753744
macro_rules! fn_opt_trans {
754745
($function:ident, $invocation:expr, $trans:ident; [$($additional_param:ty),*]) => {
755746
fn $function(&mut self, $(_: $additional_param),*) -> Option<Trans<T, E>> {

crate/workspace_tests/src/application_test_support/autexousious_application.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,8 @@ mod test {
7373

7474
assert!(
7575
!object_entities.is_empty(),
76-
// kcov-ignore-start
77-
format!(
78-
// kcov-ignore-end
79-
"Expected at least one entity for the `{}` object type",
80-
object_type
81-
)
76+
"Expected at least one entity for the `{}` object type",
77+
object_type
8278
);
8379
});
8480

crate/workspace_tests/src/asset_model/config/asset_slug.rs

Lines changed: 12 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@ mod tests {
99
assert_eq!(
1010
Err(AssetSlugBuildError::NoValueProvided {
1111
segment: AssetSlugSegment::Namespace
12-
}
13-
.to_string()),
12+
}),
1413
AssetSlugBuilder::default().build()
1514
);
1615
}
@@ -20,8 +19,7 @@ mod tests {
2019
assert_eq!(
2120
Err(AssetSlugBuildError::SegmentEmpty {
2221
segment: AssetSlugSegment::Namespace
23-
}
24-
.to_string()),
22+
}),
2523
AssetSlugBuilder::default()
2624
.namespace("".to_string())
2725
.build()
@@ -34,8 +32,7 @@ mod tests {
3432
Err(AssetSlugBuildError::SegmentContainsControlChar {
3533
segment: AssetSlugSegment::Namespace,
3634
value: String::from("aœb")
37-
}
38-
.to_string()),
35+
}),
3936
AssetSlugBuilder::default()
4037
.namespace("aœb".to_string())
4138
.build()
@@ -48,8 +45,7 @@ mod tests {
4845
Err(AssetSlugBuildError::SegmentContainsWhitespace {
4946
segment: AssetSlugSegment::Namespace,
5047
value: String::from("a b")
51-
}
52-
.to_string()),
48+
}),
5349
AssetSlugBuilder::default()
5450
.namespace("a b".to_string())
5551
.build()
@@ -62,8 +58,7 @@ mod tests {
6258
Err(AssetSlugBuildError::SegmentContainsForwardSlash {
6359
segment: AssetSlugSegment::Namespace,
6460
value: String::from("a/b")
65-
}
66-
.to_string()),
61+
}),
6762
AssetSlugBuilder::default()
6863
.namespace("a/b".to_string())
6964
.build()
@@ -76,8 +71,7 @@ mod tests {
7671
Err(AssetSlugBuildError::SegmentStartsWithNumericChar {
7772
segment: AssetSlugSegment::Namespace,
7873
value: String::from("1ab")
79-
}
80-
.to_string()),
74+
}),
8175
AssetSlugBuilder::default()
8276
.namespace("1ab".to_string())
8377
.build()
@@ -89,8 +83,7 @@ mod tests {
8983
assert_eq!(
9084
Err(AssetSlugBuildError::NoValueProvided {
9185
segment: AssetSlugSegment::Name
92-
}
93-
.to_string()),
86+
}),
9487
AssetSlugBuilder::default()
9588
.namespace("test".to_string())
9689
.build()
@@ -102,8 +95,7 @@ mod tests {
10295
assert_eq!(
10396
Err(AssetSlugBuildError::SegmentEmpty {
10497
segment: AssetSlugSegment::Name
105-
}
106-
.to_string()),
98+
}),
10799
AssetSlugBuilder::default()
108100
.namespace("test".to_string())
109101
.name("".to_string())
@@ -117,8 +109,7 @@ mod tests {
117109
Err(AssetSlugBuildError::SegmentContainsControlChar {
118110
segment: AssetSlugSegment::Name,
119111
value: String::from("aœb")
120-
}
121-
.to_string()),
112+
}),
122113
AssetSlugBuilder::default()
123114
.namespace("test".to_string())
124115
.name("aœb".to_string())
@@ -132,8 +123,7 @@ mod tests {
132123
Err(AssetSlugBuildError::SegmentContainsWhitespace {
133124
segment: AssetSlugSegment::Name,
134125
value: String::from("a b")
135-
}
136-
.to_string()),
126+
}),
137127
AssetSlugBuilder::default()
138128
.namespace("test".to_string())
139129
.name("a b".to_string())
@@ -147,8 +137,7 @@ mod tests {
147137
Err(AssetSlugBuildError::SegmentContainsForwardSlash {
148138
segment: AssetSlugSegment::Name,
149139
value: String::from("a/b")
150-
}
151-
.to_string()),
140+
}),
152141
AssetSlugBuilder::default()
153142
.namespace("test".to_string())
154143
.name("a/b".to_string())
@@ -162,8 +151,7 @@ mod tests {
162151
Err(AssetSlugBuildError::SegmentStartsWithNumericChar {
163152
segment: AssetSlugSegment::Name,
164153
value: String::from("1ab")
165-
}
166-
.to_string()),
154+
}),
167155
AssetSlugBuilder::default()
168156
.namespace("test".to_string())
169157
.name("1ab".to_string())

crate/workspace_tests/src/debug_util_amethyst.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ mod test {
44

55
use debug_util_amethyst::{assert_eq_opt_trans, assert_eq_trans};
66

7-
#[macro_use]
87
macro_rules! test_opt_trans_panic {
98
($test_name:ident, $message:expr, $expected:expr, $actual:expr) => {
109
#[test]

crate/workspace_tests/src/input_reaction_play/system/button_input_reactions_transition_system.rs

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,20 @@ mod tests {
44

55
use amethyst::{
66
assets::{AssetStorage, Loader},
7-
ecs::{Builder, Entity, Read, ReadExpect, World, WorldExt, WriteStorage},
7+
ecs::{Builder, Entity, Read, ReadExpect, World, WorldExt},
88
input::InputEvent,
9-
shred::{ResourceId, SystemData},
109
shrev::EventChannel,
1110
winit::event::VirtualKeyCode,
1211
Error,
1312
};
1413
use application::IoUtils;
1514
use application_test_support::AutexousiousApplication;
16-
use derivative::Derivative;
1715
use game_input_model::{config::ControlBindings, play::ButtonInputControlled};
1816
use input_reaction_loading::{IrsLoader, IrsLoaderParams};
1917
use input_reaction_model::{
2018
config::BasicIrr,
2119
loaded::{
22-
InputReaction, InputReactions, InputReactionsHandle, InputReactionsSequence,
23-
InputReactionsSequenceHandle,
20+
InputReaction, InputReactions, InputReactionsSequence, InputReactionsSequenceHandle,
2421
},
2522
};
2623
use sequence_model::{
@@ -192,17 +189,6 @@ mod tests {
192189
ec.single_write(event);
193190
} // kcov-ignore
194191

195-
#[derive(Derivative, SystemData)]
196-
#[derivative(Debug)]
197-
struct TestSystemData<'s> {
198-
#[derivative(Debug = "ignore")]
199-
sequence_ids: WriteStorage<'s, SequenceId>,
200-
#[derivative(Debug = "ignore")]
201-
input_reactions_handles: WriteStorage<'s, InputReactionsHandle<InputReaction<BasicIrr>>>,
202-
#[derivative(Debug = "ignore")]
203-
button_input_controlleds: WriteStorage<'s, ButtonInputControlled>,
204-
}
205-
206192
struct SetupParams {
207193
sequence_id: SequenceId,
208194
input_event: Option<InputEvent<ControlBindings>>,

0 commit comments

Comments
 (0)