|
1 | | -use std::ffi::OsStr; |
2 | | -use std::process::Command; |
3 | | - |
4 | 1 | use quickjs_oxide::{ |
5 | 2 | CallableRef, CompleteOrdinaryPropertyDescriptor, Context, DescriptorField, JsBigInt, JsString, |
6 | 3 | ObjectRef, OrdinaryPropertyDescriptor, PropertyKey, Runtime, RuntimeError, Value, |
@@ -137,7 +134,8 @@ fn string_utf16_prefix_matches_pinned_quickjs() { |
137 | 134 | return; |
138 | 135 | }; |
139 | 136 | let rust = rust_observations(); |
140 | | - let upstream = oracle_observations(&oracle); |
| 137 | + let upstream = |
| 138 | + super::quickjs_oracle::eval_std_lines(&oracle, ORACLE_PROBE, "String UTF-16 prefix"); |
141 | 139 | assert_eq!(rust.len(), 11, "Rust probe breadth changed unexpectedly"); |
142 | 140 | assert_eq!( |
143 | 141 | upstream.len(), |
@@ -862,20 +860,3 @@ fn hex(value: &JsString) -> String { |
862 | 860 | .map(|unit| format!("{unit:04x}")) |
863 | 861 | .collect() |
864 | 862 | } |
865 | | - |
866 | | -fn oracle_observations(oracle: &OsStr) -> Vec<String> { |
867 | | - let output = Command::new(oracle) |
868 | | - .args(["-e", ORACLE_PROBE]) |
869 | | - .output() |
870 | | - .expect("run QuickJS String UTF-16 prefix oracle"); |
871 | | - assert!( |
872 | | - output.status.success(), |
873 | | - "QuickJS String UTF-16 prefix oracle failed: {}", |
874 | | - String::from_utf8_lossy(&output.stderr) |
875 | | - ); |
876 | | - String::from_utf8(output.stdout) |
877 | | - .expect("QuickJS String UTF-16 prefix oracle emitted non-UTF-8 output") |
878 | | - .lines() |
879 | | - .map(str::to_owned) |
880 | | - .collect() |
881 | | -} |
0 commit comments