1
-
2
1
function on_test ()
3
- local post_update_schedule = world .get_schedule_by_name (" PostUpdate" )
4
-
5
- local test_system = post_update_schedule :get_system_by_name (" on_test_post_update" )
6
-
7
- local system_a = world .add_system (
8
- post_update_schedule ,
9
- system_builder (" custom_system_a" , script_id )
10
- :after (test_system )
11
- )
12
-
13
- local system_b = world .add_system (
14
- post_update_schedule ,
15
- system_builder (" custom_system_b" , script_id )
16
- :after (test_system )
17
- )
2
+ local post_update_schedule = world .get_schedule_by_name (" PostUpdate" )
3
+
4
+ local test_system = post_update_schedule :get_system_by_name (" on_test_post_update" )
5
+
6
+ local script_attachment = ScriptAttachment .new_entity_script (entity , script_asset )
18
7
19
- -- generate a schedule graph and verify it's what we expect
20
- local dot_graph = post_update_schedule :render_dot ()
8
+ local system_a = world .add_system (
9
+ post_update_schedule ,
10
+ system_builder (" custom_system_a" , script_attachment )
11
+ :after (test_system )
12
+ )
21
13
22
- local expected_dot_graph = [[
14
+ local system_b = world .add_system (
15
+ post_update_schedule ,
16
+ system_builder (" custom_system_b" , script_attachment )
17
+ :after (test_system )
18
+ )
19
+
20
+ -- generate a schedule graph and verify it's what we expect
21
+ local dot_graph = post_update_schedule :render_dot ()
22
+
23
+ local expected_dot_graph = [[
23
24
digraph {
24
25
node_0 [label="bevy_asset::assets::Assets<bevy_asset::folder::LoadedFolder>::asset_events"];
25
26
node_1 [label="bevy_asset::assets::Assets<bevy_asset::assets::LoadedUntypedAsset>::asset_events"];
26
27
node_2 [label="bevy_asset::assets::Assets<()>::asset_events"];
27
28
node_3 [label="bevy_asset::assets::Assets<bevy_mod_scripting_core::asset::ScriptAsset>::asset_events"];
28
29
node_4 [label="bevy_mod_scripting_core::bindings::allocator::garbage_collector"];
29
- node_5 [label="on_test_post_update "];
30
- node_6 [label="script_integration_test_harness::dummy_before_post_update_system "];
31
- node_7 [label="script_integration_test_harness::dummy_post_update_system "];
30
+ node_5 [label="script_integration_test_harness::dummy_before_post_update_system "];
31
+ node_6 [label="script_integration_test_harness::dummy_post_update_system "];
32
+ node_7 [label="on_test_post_update "];
32
33
node_8 [label="custom_system_a"];
33
34
node_9 [label="custom_system_b"];
34
35
node_10 [label="SystemSet AssetEvents"];
@@ -42,11 +43,10 @@ digraph {
42
43
node_4 -> node_11 [color=red, label="child of", arrowhead=diamond];
43
44
node_8 -> node_12 [color=red, label="child of", arrowhead=diamond];
44
45
node_9 -> node_13 [color=red, label="child of", arrowhead=diamond];
45
- node_5 -> node_8 [color=blue, label="runs before", arrowhead=normal];
46
- node_5 -> node_9 [color=blue, label="runs before", arrowhead=normal];
47
- node_6 -> node_7 [color=blue, label="runs before", arrowhead=normal];
46
+ node_5 -> node_6 [color=blue, label="runs before", arrowhead=normal];
47
+ node_7 -> node_8 [color=blue, label="runs before", arrowhead=normal];
48
+ node_7 -> node_9 [color=blue, label="runs before", arrowhead=normal];
48
49
}
49
50
]]
50
-
51
- assert_str_eq (dot_graph , expected_dot_graph , " Expected the schedule graph to match the expected graph" )
51
+ assert_str_eq (dot_graph , expected_dot_graph , " Expected the schedule graph to match the expected graph" )
52
52
end
0 commit comments