Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove extra Replication insert #231

Merged
merged 2 commits into from
Apr 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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