Skip to content

Commit 638535a

Browse files
committed
test: #697 — move stdlib_io FFI coverage into behavioral tests
Moves the 155 entries from `test_ffi_surface_stdlib_io.ts` into `@covers` annotations attached to the existing behavioral fixtures for each surface: - fetch / Response / Request / Headers / Blob → test_gap_fetch_response.ts - node:stream/web → test_parity_stream_web.ts - node:http / node:https → test_parity_http.ts - node:net + TLS upgrade → test_net_socket.ts - node:readline → test_parity_readline.ts - node:worker_threads → test_parity_worker_threads.ts - WebSocket upgrade → test_node_http_ws_upgrade.ts - framework (multipart, request, response, server) → test_fastify_integration.ts Regenerated via `./test-coverage/regen_ts_surface_inventory.py`: `test_ffi_surface_stdlib_io.ts` shrinks from 155 unique FFI names to 0. `./test-coverage/audit.sh --markdown` still reports 100% TypeScript and combined FFI coverage (1790/1790).
1 parent 209ba11 commit 638535a

11 files changed

Lines changed: 229 additions & 191 deletions

test-coverage/COVERAGE.md

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
# Perry FFI Test Coverage
22

3-
Generated: 2026-05-11T17:05:37Z
3+
Generated: 2026-05-13T16:15:50Z
44

55
## Summary
66

7-
- **Total FFI functions:** 1771
8-
- **Covered by TypeScript fixtures:** 1771 (100.0%)
9-
- **Covered by Rust tests:** 1430 (80.7%)
10-
- **Covered by either TS or Rust:** 1771 (100.0%)
7+
- **Total FFI functions:** 1790
8+
- **Covered by TypeScript fixtures:** 1790 (100.0%)
9+
- **Covered by Rust tests:** 1437 (80.3%)
10+
- **Covered by either TS or Rust:** 1790 (100.0%)
1111
- **Uncovered by either TS or Rust:** 0
1212

1313
## Coverage by File
@@ -16,7 +16,7 @@ Generated: 2026-05-11T17:05:37Z
1616
|------|-------|------------|--------------|----------|-------------|-------------------|
1717
| `crates/perry-runtime/src/arena.rs` | 4 | 4 | 4 | 4 | 100% | 100% |
1818
| `crates/perry-runtime/src/arkts_callbacks.rs` | 8 | 8 | 3 | 8 | 100% | 100% |
19-
| `crates/perry-runtime/src/array.rs` | 74 | 74 | 74 | 74 | 100% | 100% |
19+
| `crates/perry-runtime/src/array.rs` | 77 | 77 | 77 | 77 | 100% | 100% |
2020
| `crates/perry-runtime/src/bigint.rs` | 28 | 28 | 28 | 28 | 100% | 100% |
2121
| `crates/perry-runtime/src/box.rs` | 3 | 3 | 0 | 3 | 100% | 100% |
2222
| `crates/perry-runtime/src/buffer.rs` | 77 | 77 | 77 | 77 | 100% | 100% |
@@ -41,12 +41,12 @@ Generated: 2026-05-11T17:05:37Z
4141
| `crates/perry-runtime/src/media_playback.rs` | 15 | 15 | 0 | 15 | 100% | 100% |
4242
| `crates/perry-runtime/src/net.rs` | 11 | 11 | 11 | 11 | 100% | 100% |
4343
| `crates/perry-runtime/src/node_stream.rs` | 6 | 6 | 1 | 6 | 100% | 100% |
44-
| `crates/perry-runtime/src/object.rs` | 77 | 77 | 77 | 77 | 100% | 100% |
44+
| `crates/perry-runtime/src/object.rs` | 80 | 80 | 80 | 80 | 100% | 100% |
4545
| `crates/perry-runtime/src/os.rs` | 29 | 29 | 29 | 29 | 100% | 100% |
46-
| `crates/perry-runtime/src/path.rs` | 13 | 13 | 6 | 13 | 100% | 100% |
46+
| `crates/perry-runtime/src/path.rs` | 16 | 16 | 6 | 16 | 100% | 100% |
4747
| `crates/perry-runtime/src/plugin.rs` | 22 | 22 | 22 | 22 | 100% | 100% |
4848
| `crates/perry-runtime/src/process.rs` | 4 | 4 | 0 | 4 | 100% | 100% |
49-
| `crates/perry-runtime/src/promise.rs` | 34 | 34 | 22 | 34 | 100% | 100% |
49+
| `crates/perry-runtime/src/promise.rs` | 36 | 36 | 22 | 36 | 100% | 100% |
5050
| `crates/perry-runtime/src/proxy.rs` | 19 | 19 | 1 | 19 | 100% | 100% |
5151
| `crates/perry-runtime/src/regex.rs` | 19 | 19 | 19 | 19 | 100% | 100% |
5252
| `crates/perry-runtime/src/set.rs` | 11 | 11 | 11 | 11 | 100% | 100% |
@@ -56,7 +56,7 @@ Generated: 2026-05-11T17:05:37Z
5656
| `crates/perry-runtime/src/symbol.rs` | 16 | 16 | 8 | 16 | 100% | 100% |
5757
| `crates/perry-runtime/src/text.rs` | 4 | 4 | 0 | 4 | 100% | 100% |
5858
| `crates/perry-runtime/src/thread.rs` | 5 | 5 | 3 | 5 | 100% | 100% |
59-
| `crates/perry-runtime/src/timer.rs` | 17 | 17 | 9 | 17 | 100% | 100% |
59+
| `crates/perry-runtime/src/timer.rs` | 18 | 18 | 10 | 18 | 100% | 100% |
6060
| `crates/perry-runtime/src/tty.rs` | 8 | 8 | 8 | 8 | 100% | 100% |
6161
| `crates/perry-runtime/src/tui/ffi.rs` | 32 | 32 | 30 | 32 | 100% | 100% |
6262
| `crates/perry-runtime/src/tui/hooks.rs` | 26 | 26 | 26 | 26 | 100% | 100% |
@@ -69,6 +69,7 @@ Generated: 2026-05-11T17:05:37Z
6969
| `crates/perry-runtime/src/value.rs` | 54 | 54 | 54 | 54 | 100% | 100% |
7070
| `crates/perry-runtime/src/watchos_game_loop.rs` | 2 | 2 | 1 | 2 | 100% | 100% |
7171
| `crates/perry-runtime/src/weakref.rs` | 15 | 15 | 1 | 15 | 100% | 100% |
72+
| `crates/perry-runtime/src/webassembly.rs` | 7 | 7 | 0 | 7 | 100% | 100% |
7273
| `crates/perry-stdlib/src/argon2.rs` | 5 | 5 | 2 | 5 | 100% | 100% |
7374
| `crates/perry-stdlib/src/async_local_storage.rs` | 6 | 6 | 5 | 6 | 100% | 100% |
7475
| `crates/perry-stdlib/src/axios.rs` | 8 | 8 | 8 | 8 | 100% | 100% |

test-files/test_fastify_integration.ts

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,39 @@ app.listen({ port: port }, () => {
2626
// Sentinel line the harness waits for before starting curl assertions.
2727
console.log("ready port=" + port);
2828
});
29+
30+
/*
31+
@covers
32+
crates/perry-stdlib/src/framework/multipart.rs:
33+
- js_multipart_parse
34+
- js_multipart_parse_with_sizes
35+
crates/perry-stdlib/src/framework/request.rs:
36+
- js_http_request_body_length
37+
- js_http_request_content_type
38+
- js_http_request_has_header
39+
- js_http_request_headers_all
40+
- js_http_request_id
41+
- js_http_request_is_method
42+
- js_http_request_query_all
43+
- js_http_request_query_param
44+
crates/perry-stdlib/src/framework/response.rs:
45+
- js_http_respond_error
46+
- js_http_respond_html
47+
- js_http_respond_json
48+
- js_http_respond_not_found
49+
- js_http_respond_redirect
50+
- js_http_respond_status_text
51+
- js_http_respond_text
52+
- js_http_respond_with_headers
53+
crates/perry-stdlib/src/framework/server.rs:
54+
- js_http_request_body
55+
- js_http_request_header
56+
- js_http_request_method
57+
- js_http_request_path
58+
- js_http_request_query
59+
- js_http_respond
60+
- js_http_server_accept
61+
- js_http_server_accept_v2
62+
- js_http_server_close
63+
- js_http_server_create
64+
*/

test-files/test_ffi_surface_runtime_core.ts

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
// inventory into behavioral tests as each area gets deeper compatibility
77
// coverage.
88
//
9-
// Inventory entries: 915 unique FFI names, 934 declarations.
9+
// Inventory entries: 919 unique FFI names, 920 declarations.
1010

1111
const testFfiSurfaceRuntimeCoreVersion = 1;
1212
if (testFfiSurfaceRuntimeCoreVersion !== 1) {
@@ -40,6 +40,7 @@ crates/perry-runtime/src/array.rs:
4040
- js_array_find_last_index
4141
- js_array_flat
4242
- js_array_flatMap
43+
- js_array_flat_depth
4344
- js_array_forEach
4445
- js_array_from_f64
4546
- js_array_from_jsvalue
@@ -78,6 +79,8 @@ crates/perry-runtime/src/array.rs:
7879
- js_array_values
7980
- js_array_with
8081
- js_iterator_to_array
82+
- js_tagged_template_register_raw
83+
- js_template_raw
8184
crates/perry-runtime/src/bigint.rs:
8285
- js_bigint_add
8386
- js_bigint_and
@@ -228,7 +231,6 @@ crates/perry-runtime/src/builtins.rs:
228231
- js_loose_eq
229232
- js_lt
230233
- js_mod
231-
- js_mul
232234
- js_number_coerce
233235
- js_number_is_finite
234236
- js_number_is_integer
@@ -499,12 +501,9 @@ crates/perry-runtime/src/net.rs:
499501
- js_net_server_address
500502
- js_net_server_close
501503
- js_net_server_listen
502-
- js_net_socket_destroy
503-
- js_net_socket_end
504504
- js_net_socket_read
505505
- js_net_socket_remote_address
506506
- js_net_socket_remote_port
507-
- js_net_socket_write
508507
crates/perry-runtime/src/node_stream.rs:
509508
- js_node_stream_duplex_new
510509
- js_node_stream_passthrough_new
@@ -573,6 +572,7 @@ crates/perry-runtime/src/object.rs:
573572
- js_register_handle_method_dispatch
574573
- js_register_handle_property_dispatch
575574
- js_register_handle_property_set_dispatch
575+
- js_unresolved_default_call
576576
- js_unresolved_namespace_stub
577577
- js_value_to_object
578578
- perry_key_content_hash
@@ -613,11 +613,14 @@ crates/perry-runtime/src/path.rs:
613613
- js_path_format
614614
- js_path_is_absolute
615615
- js_path_join
616+
- js_path_matches_glob
616617
- js_path_normalize
617618
- js_path_parse
618619
- js_path_relative
619620
- js_path_resolve
621+
- js_path_resolve_join
620622
- js_path_sep_get
623+
- js_path_to_namespaced_path
621624
crates/perry-runtime/src/plugin.rs:
622625
- perry_plugin_count
623626
- perry_plugin_discover
@@ -647,9 +650,11 @@ crates/perry-runtime/src/process.rs:
647650
crates/perry-runtime/src/promise.rs:
648651
- js_array_from_async
649652
- js_assimilate_thenable
653+
- js_async_first_call
650654
- js_async_step_chain
651655
- js_async_step_done
652656
- js_await_any_promise
657+
- js_get_current_step_closure
653658
- js_is_promise
654659
- js_iter_result_get_done
655660
- js_iter_result_get_value
@@ -735,15 +740,6 @@ crates/perry-runtime/src/static_plugins.rs:
735740
- perry_resolve_static_plugin
736741
crates/perry-runtime/src/stdlib_stubs.rs:
737742
- js_stdlib_init_dispatch
738-
- js_ws_connect
739-
- js_ws_connect_start
740-
- js_ws_is_open
741-
- js_ws_message_count
742-
- js_ws_process_pending
743-
- js_ws_receive
744-
- js_ws_server_close
745-
- js_ws_server_new
746-
- js_ws_wait_for_message
747743
crates/perry-runtime/src/string.rs:
748744
- js_atob
749745
- js_btoa
@@ -839,6 +835,7 @@ crates/perry-runtime/src/timer.rs:
839835
- js_interval_timer_tick
840836
- js_set_timeout
841837
- js_set_timeout_callback
838+
- js_set_timeout_callback_args
842839
- js_set_timeout_value
843840
- js_sleep_ms
844841
- js_timer_has_pending
@@ -974,4 +971,12 @@ crates/perry-runtime/src/weakref.rs:
974971
- js_weakset_delete
975972
- js_weakset_has
976973
- js_weakset_new
974+
crates/perry-runtime/src/webassembly.rs:
975+
- js_webassembly_call_export_0
976+
- js_webassembly_call_export_1
977+
- js_webassembly_call_export_2
978+
- js_webassembly_call_export_3
979+
- js_webassembly_call_export_4
980+
- js_webassembly_instantiate
981+
- js_webassembly_validate
977982
*/

test-files/test_ffi_surface_stdlib_io.ts

Lines changed: 1 addition & 167 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
// inventory into behavioral tests as each area gets deeper compatibility
77
// coverage.
88
//
9-
// Inventory entries: 155 unique FFI names, 173 declarations.
9+
// Inventory entries: 0 unique FFI names, 0 declarations.
1010

1111
const testFfiSurfaceStdlibIoVersion = 1;
1212
if (testFfiSurfaceStdlibIoVersion !== 1) {
@@ -16,170 +16,4 @@ console.log("test_ffi_surface_stdlib_io: ok");
1616

1717
/*
1818
@covers
19-
crates/perry-stdlib/src/fetch.rs:
20-
- js_blob_array_buffer
21-
- js_blob_bytes
22-
- js_blob_size
23-
- js_blob_slice
24-
- js_blob_stream
25-
- js_blob_text
26-
- js_blob_type
27-
- js_fetch_get
28-
- js_fetch_get_with_auth
29-
- js_fetch_post
30-
- js_fetch_post_with_auth
31-
- js_fetch_response_count
32-
- js_fetch_response_json
33-
- js_fetch_response_ok
34-
- js_fetch_response_status
35-
- js_fetch_response_status_text
36-
- js_fetch_response_text
37-
- js_fetch_stream_close
38-
- js_fetch_stream_poll
39-
- js_fetch_stream_start
40-
- js_fetch_stream_status
41-
- js_fetch_text
42-
- js_fetch_with_options
43-
- js_headers_delete
44-
- js_headers_entries
45-
- js_headers_for_each
46-
- js_headers_get
47-
- js_headers_has
48-
- js_headers_keys
49-
- js_headers_new
50-
- js_headers_set
51-
- js_headers_values
52-
- js_request_get_body
53-
- js_request_get_method
54-
- js_request_get_url
55-
- js_request_new
56-
- js_response_array_buffer
57-
- js_response_blob
58-
- js_response_body
59-
- js_response_clone
60-
- js_response_get_headers
61-
- js_response_new
62-
- js_response_static_json
63-
- js_response_static_redirect
64-
crates/perry-stdlib/src/framework/multipart.rs:
65-
- js_multipart_parse
66-
- js_multipart_parse_with_sizes
67-
crates/perry-stdlib/src/framework/request.rs:
68-
- js_http_request_body_length
69-
- js_http_request_content_type
70-
- js_http_request_has_header
71-
- js_http_request_headers_all
72-
- js_http_request_id
73-
- js_http_request_is_method
74-
- js_http_request_query_all
75-
- js_http_request_query_param
76-
crates/perry-stdlib/src/framework/response.rs:
77-
- js_http_respond_error
78-
- js_http_respond_html
79-
- js_http_respond_json
80-
- js_http_respond_not_found
81-
- js_http_respond_redirect
82-
- js_http_respond_status_text
83-
- js_http_respond_text
84-
- js_http_respond_with_headers
85-
crates/perry-stdlib/src/framework/server.rs:
86-
- js_http_request_body
87-
- js_http_request_header
88-
- js_http_request_method
89-
- js_http_request_path
90-
- js_http_request_query
91-
- js_http_respond
92-
- js_http_server_accept
93-
- js_http_server_accept_v2
94-
- js_http_server_close
95-
- js_http_server_create
96-
crates/perry-stdlib/src/http.rs:
97-
- js_http_client_request_end
98-
- js_http_client_request_write
99-
- js_http_get
100-
- js_http_on
101-
- js_http_process_pending
102-
- js_http_request
103-
- js_http_response_headers
104-
- js_http_set_header
105-
- js_http_set_timeout
106-
- js_http_status_code
107-
- js_http_status_message
108-
- js_https_get
109-
- js_https_request
110-
crates/perry-stdlib/src/net/mod.rs:
111-
- js_net_process_pending
112-
- js_net_socket_alloc
113-
- js_net_socket_connect
114-
- js_net_socket_destroy
115-
- js_net_socket_end
116-
- js_net_socket_method_connect
117-
- js_net_socket_on
118-
- js_net_socket_upgrade_tls
119-
- js_net_socket_write
120-
- js_tls_connect
121-
crates/perry-stdlib/src/readline.rs:
122-
- js_readline_close
123-
- js_readline_create_interface
124-
- js_readline_has_active
125-
- js_readline_on
126-
- js_readline_question
127-
crates/perry-stdlib/src/streams.rs:
128-
- js_readable_stream_cancel
129-
- js_readable_stream_controller_close
130-
- js_readable_stream_controller_desired_size
131-
- js_readable_stream_controller_enqueue
132-
- js_readable_stream_controller_error
133-
- js_readable_stream_from_blob
134-
- js_readable_stream_from_iterable
135-
- js_readable_stream_from_response
136-
- js_readable_stream_get_reader
137-
- js_readable_stream_locked
138-
- js_readable_stream_pipe_through
139-
- js_readable_stream_pipe_to
140-
- js_readable_stream_subclass_init
141-
- js_readable_stream_tee
142-
- js_reader_cancel
143-
- js_reader_closed
144-
- js_reader_read
145-
- js_reader_release_lock
146-
- js_stream_unwrap_handle
147-
- js_streams_throw_byob_not_implemented
148-
- js_streams_throw_byte_length_not_implemented
149-
- js_transform_stream_new
150-
- js_transform_stream_readable
151-
- js_transform_stream_subclass_init
152-
- js_transform_stream_writable
153-
- js_writable_stream_abort
154-
- js_writable_stream_close
155-
- js_writable_stream_get_writer
156-
- js_writable_stream_locked
157-
- js_writable_stream_new
158-
- js_writable_stream_subclass_init
159-
- js_writer_abort
160-
- js_writer_close
161-
- js_writer_closed
162-
- js_writer_desired_size
163-
- js_writer_ready
164-
- js_writer_release_lock
165-
- js_writer_write
166-
crates/perry-stdlib/src/worker_threads.rs:
167-
- js_worker_threads_get_worker_data
168-
- js_worker_threads_has_pending
169-
- js_worker_threads_on
170-
- js_worker_threads_parent_port
171-
- js_worker_threads_post_message
172-
- js_worker_threads_process_pending
173-
crates/perry-stdlib/src/ws.rs:
174-
- js_ws_connect
175-
- js_ws_connect_start
176-
- js_ws_handle_to_i64
177-
- js_ws_is_open
178-
- js_ws_message_count
179-
- js_ws_process_pending
180-
- js_ws_receive
181-
- js_ws_send_to_client
182-
- js_ws_server_close
183-
- js_ws_server_new
184-
- js_ws_wait_for_message
18519
*/

0 commit comments

Comments
 (0)