File tree 2 files changed +25
-1
lines changed
2 files changed +25
-1
lines changed Original file line number Diff line number Diff line change @@ -517,7 +517,7 @@ pub static KNOWN_TY_BASED_BUNDLES: &[BundleDoc<RuleOptions>] = &[
517
517
fallback_to_outer : FallbackToOuterBehavior :: EatBoth ,
518
518
..RuleOptions :: STATELESS_2021
519
519
} ,
520
- doc : "A backwards-compatible proposal by @dianne that behaves close to the\
520
+ doc : "A backwards-compatible proposal by @dianne that behaves close to the \
521
521
2024 stateless proposal.",
522
522
} ,
523
523
BundleDoc {
Original file line number Diff line number Diff line change @@ -27,6 +27,30 @@ fn decode_base64<T: Decode>(x: JsValue) -> Option<T> {
27
27
Some ( bincode:: decode_from_slice ( & bits, config) . ok ( ) ?. 0 )
28
28
}
29
29
30
+ #[ test]
31
+ /// Ensure we don't change the encoding of rulesets, as that would break saved links into the app.
32
+ fn ruleset_encodings ( ) -> anyhow:: Result < ( ) > {
33
+ use std:: fmt:: Write ;
34
+ let mut out = String :: new ( ) ;
35
+ for b in KNOWN_TY_BASED_BUNDLES {
36
+ let ruleset = RuleSetJs {
37
+ this_solver : true ,
38
+ ty_based : b. ruleset ,
39
+ bm_based : Conf :: rfc2005 ( ) ,
40
+ } ;
41
+ let _ = writeln ! ( & mut out, "{}: {}" , b. name, ruleset. encode( ) ) ;
42
+ }
43
+ insta:: with_settings!( {
44
+ snapshot_path => "../tests/snapshots" ,
45
+ snapshot_suffix => "ruleset-encodings" ,
46
+ prepend_module_to_snapshot => false ,
47
+ omit_expression => true ,
48
+ } , {
49
+ insta:: assert_snapshot!( out) ;
50
+ } ) ;
51
+ Ok ( ( ) )
52
+ }
53
+
30
54
/// Like `RuleSet` but remembers the ruleset of the other solver to avoid losing state in the
31
55
/// frontend.
32
56
#[ wasm_bindgen]
You can’t perform that action at this time.
0 commit comments