Skip to content

Commit 280d925

Browse files
committed
refactor(tests): consolidate promise oracle targets
1 parent 0df9eeb commit 280d925

8 files changed

Lines changed: 25 additions & 8 deletions

File tree

.github/workflows/ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ jobs:
8080
cargo test --locked --test oracle_string_methods
8181
cargo test --locked --test oracle_object_semantics
8282
cargo test --locked --test oracle_regexp
83+
cargo test --locked --test oracle_promise
8384
cargo test --locked --features test262-host \
8485
--test unsupported_diagnostics \
8586
--test oracle_create_realm --test oracle_host_gc --test oracle_is_html_dda
@@ -91,6 +92,7 @@ jobs:
9192
cargo clippy --locked --test oracle_string_methods -- -D warnings
9293
cargo clippy --locked --test oracle_object_semantics -- -D warnings
9394
cargo clippy --locked --test oracle_regexp -- -D warnings
95+
cargo clippy --locked --test oracle_promise -- -D warnings
9496
cargo clippy --locked -p quickjs-oxide --features test262-host \
9597
--lib --bins -- -D warnings
9698
cargo clippy --locked -p quickjs-oxide --features test262-host \

scripts/check-oracle-registry.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,3 +87,5 @@ check_registry object Object tests/oracle_object_semantics.rs \
8787
tests/oracle/object oracle/object oracle_object
8888
check_registry regexp RegExp tests/oracle_regexp.rs \
8989
tests/oracle/regexp oracle/regexp oracle_regexp_
90+
check_registry promise Promise tests/oracle_promise.rs \
91+
tests/oracle/promise oracle/promise oracle_promise_

tests/oracle_promise_aggregates.rs renamed to tests/oracle/promise/oracle_promise_aggregates.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use quickjs_oxide::{Context, Runtime, RuntimeError, Value};
22

3-
const FIXTURE: &str = include_str!("fixtures/r3q_promise_aggregates.js");
4-
const EXPECTED: &str = include_str!("fixtures/r3q_promise_aggregates.quickjs-2026-06-04.txt");
3+
const FIXTURE: &str = include_str!("../../fixtures/r3q_promise_aggregates.js");
4+
const EXPECTED: &str = include_str!("../../fixtures/r3q_promise_aggregates.quickjs-2026-06-04.txt");
55

66
fn eval(context: &mut Context, source: &str) -> Value {
77
context.eval(source).unwrap_or_else(|error| {

tests/oracle_promise_all.rs renamed to tests/oracle/promise/oracle_promise_all.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use quickjs_oxide::{Context, Runtime, RuntimeError, Value};
22

3-
const FIXTURE: &str = include_str!("fixtures/r3p_promise_all.js");
4-
const EXPECTED: &str = include_str!("fixtures/r3p_promise_all.quickjs-2026-06-04.txt");
3+
const FIXTURE: &str = include_str!("../../fixtures/r3p_promise_all.js");
4+
const EXPECTED: &str = include_str!("../../fixtures/r3p_promise_all.quickjs-2026-06-04.txt");
55

66
fn eval(context: &mut Context, source: &str) -> Value {
77
context.eval(source).unwrap_or_else(|error| {

tests/oracle_promise_finally.rs renamed to tests/oracle/promise/oracle_promise_finally.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use quickjs_oxide::{Context, Runtime, RuntimeError, Value};
22

3-
const FIXTURE: &str = include_str!("fixtures/r3o_promise_finally.js");
4-
const EXPECTED: &str = include_str!("fixtures/r3o_promise_finally.quickjs-2026-06-04.txt");
3+
const FIXTURE: &str = include_str!("../../fixtures/r3o_promise_finally.js");
4+
const EXPECTED: &str = include_str!("../../fixtures/r3o_promise_finally.quickjs-2026-06-04.txt");
55

66
fn eval(context: &mut Context, source: &str) -> Value {
77
context.eval(source).unwrap_or_else(|error| {
File renamed without changes.

tests/oracle_promise_static.rs renamed to tests/oracle/promise/oracle_promise_static.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use quickjs_oxide::{Context, Runtime, RuntimeError, Value};
22

3-
const FIXTURE: &str = include_str!("fixtures/r3n_promise_static.js");
4-
const EXPECTED: &str = include_str!("fixtures/r3n_promise_static.quickjs-2026-06-04.txt");
3+
const FIXTURE: &str = include_str!("../../fixtures/r3n_promise_static.js");
4+
const EXPECTED: &str = include_str!("../../fixtures/r3n_promise_static.quickjs-2026-06-04.txt");
55

66
fn eval(context: &mut Context, source: &str) -> Value {
77
context.eval(source).unwrap_or_else(|error| {

tests/oracle_promise.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// Keep the Promise oracle implementations in separate modules so their
2+
// private helpers remain isolated while Cargo builds one integration target.
3+
4+
#[path = "oracle/promise/oracle_promise_aggregates.rs"]
5+
mod oracle_promise_aggregates;
6+
#[path = "oracle/promise/oracle_promise_all.rs"]
7+
mod oracle_promise_all;
8+
#[path = "oracle/promise/oracle_promise_finally.rs"]
9+
mod oracle_promise_finally;
10+
#[path = "oracle/promise/oracle_promise_jobs.rs"]
11+
mod oracle_promise_jobs;
12+
#[path = "oracle/promise/oracle_promise_static.rs"]
13+
mod oracle_promise_static;

0 commit comments

Comments
 (0)