Skip to content

Commit

Permalink
Remove extra Replication insert [skip ci] (#231)
Browse files Browse the repository at this point in the history
* Remove extra `Replication` insert

Was present even before refactoring in the `insertion` test, but after
splitting it into multiple tests I noticed that it not needed, all
entities already spawned with this component.

* Rename for consistency
  • Loading branch information
Shatur authored Apr 15, 2024
1 parent 70db508 commit 3cbbfa9
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions tests/insertion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ fn table_storage() {
server_app
.world
.entity_mut(server_entity)
.insert((Replication, TableComponent));
.insert(TableComponent);

server_app.update();
server_app.exchange_with_client(&mut client_app);
Expand Down Expand Up @@ -70,7 +70,7 @@ fn sparse_set_storage() {
server_app
.world
.entity_mut(server_entity)
.insert((Replication, SparseSetComponent));
.insert(SparseSetComponent);

server_app.update();
server_app.exchange_with_client(&mut client_app);
Expand Down Expand Up @@ -119,7 +119,7 @@ fn mapped_existing_entity() {
server_app
.world
.entity_mut(server_entity)
.insert((Replication, MappedComponent(server_map_entity)));
.insert(MappedComponent(server_map_entity));

server_app.update();
server_app.exchange_with_client(&mut client_app);
Expand Down Expand Up @@ -163,7 +163,7 @@ fn mapped_new_entity() {
server_app
.world
.entity_mut(server_entity)
.insert((Replication, MappedComponent(server_map_entity)));
.insert(MappedComponent(server_map_entity));

server_app.update();
server_app.exchange_with_client(&mut client_app);
Expand Down Expand Up @@ -204,7 +204,7 @@ fn group() {
server_app
.world
.entity_mut(server_entity)
.insert((Replication, (GroupComponentA, GroupComponentB)));
.insert((GroupComponentA, GroupComponentB));

server_app.update();
server_app.exchange_with_client(&mut client_app);
Expand Down Expand Up @@ -242,18 +242,18 @@ fn not_replicated() {
server_app
.world
.entity_mut(server_entity)
.insert((Replication, NotReplicatedComponent));
.insert(NotReplicatedComponent);

server_app.update();
server_app.exchange_with_client(&mut client_app);
client_app.update();

let non_replicated_components = client_app
let not_replicated_components = client_app
.world
.query_filtered::<(), With<NotReplicatedComponent>>()
.iter(&client_app.world)
.count();
assert_eq!(non_replicated_components, 0);
assert_eq!(not_replicated_components, 0);
}

#[test]
Expand Down

0 comments on commit 3cbbfa9

Please sign in to comment.