fix(tester): correct edition mapping for ES16#5146
fix(tester): correct edition mapping for ES16#5146Xavrir wants to merge 3 commits intoboa-dev:mainfrom
Conversation
Test262 conformance changes
Tested main commit: |
tests/tester/src/edition.rs
Outdated
| #[cfg(test)] | ||
| mod tests { | ||
| use super::SpecEdition; | ||
| use crate::{ | ||
| Locale, | ||
| read::{MetaData, TestFlag}, | ||
| }; | ||
|
|
||
| fn metadata(features: &[&str]) -> MetaData { | ||
| MetaData { | ||
| description: "test".into(), | ||
| esid: None, | ||
| es5id: None, | ||
| es6id: None, | ||
| info: "".into(), | ||
| features: features | ||
| .iter() | ||
| .map(|feature| (*feature).into()) | ||
| .collect::<Vec<Box<str>>>() | ||
| .into_boxed_slice(), | ||
| includes: Box::default(), | ||
| flags: Box::<[TestFlag]>::default(), | ||
| negative: None, | ||
| locale: Locale::default(), | ||
| } | ||
| } | ||
|
|
||
| #[test] | ||
| fn maps_arraybuffer_transfer_to_es15() { | ||
| let metadata = metadata(&["arraybuffer-transfer"]); | ||
|
|
||
| assert_eq!( | ||
| SpecEdition::from_test_metadata(&metadata), | ||
| Ok(SpecEdition::ES15) | ||
| ); | ||
| } | ||
|
|
||
| #[test] | ||
| fn maps_set_methods_to_es16() { | ||
| let metadata = metadata(&["set-methods"]); | ||
|
|
||
| assert_eq!( | ||
| SpecEdition::from_test_metadata(&metadata), | ||
| Ok(SpecEdition::ES16) | ||
| ); | ||
| } | ||
| } |
There was a problem hiding this comment.
I don't think we need tests for these. Not because tests are bad or anything, but because the editions mapping is so in-flight sometimes that it's not really useful to test if specific features map to a certain version.
Case in point, if we had tests for these, then you wouldn't have been able to change the edition of these two features without changing the tests.
There was a problem hiding this comment.
Got it, I removed those mapping tests in 50e871f. You’re right that pinning exact feature editions there would just create churn.
tests/tester/src/main.rs
Outdated
| } | ||
|
|
||
| #[test] | ||
| fn apply_updates_es16_statistics() { |
There was a problem hiding this comment.
This test doesn't really reflect how we keep count of tests; usually if ES6 has a test, that test also counts for the total in ES7 and onwards, so it doesn't make sense to have ES15 with a lower test count than ES16
There was a problem hiding this comment.
Removed the extra ES16 stats tests in 50e871f and kept the PR focused on the edition fix plus the required tester plumbing.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #5146 +/- ##
===========================================
+ Coverage 47.24% 59.50% +12.26%
===========================================
Files 476 580 +104
Lines 46892 63189 +16297
===========================================
+ Hits 22154 37602 +15448
- Misses 24738 25587 +849 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Summary
arraybuffer-transferto ES15 andset-methodsto ES16 in the test262 feature tableSpecEdition::ES16support to tester stats and backward-compatible result deserializationTesting
cargo test -p boa_testercargo clippy -p boa_tester --all-features --all-targetscargo make run-ciCloses #5053