Skip to content

Commit c2f49d9

Browse files
nicklaslclaude
andauthored
test: add 45 missing resolver spec test cases (#335)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent f26be1e commit c2f49d9

File tree

3 files changed

+2056
-60
lines changed

3 files changed

+2056
-60
lines changed

confidence-resolver/src/resolver_spec_tests.rs

Lines changed: 71 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -490,11 +490,9 @@ spec_test!(nested_segment_match);
490490
spec_test!(circular_segment_dependency);
491491

492492
// Variant / assignment
493-
spec_test!(variant_match);
494493
spec_test!(fallthrough_then_match);
495494
spec_test!(client_default_match);
496495
spec_test!(bucket_gap_no_match);
497-
spec_test!(full_rollout_no_targeting_key);
498496
spec_test!(multi_variant_no_targeting_key);
499497

500498
// Any rule with inner rules
@@ -572,3 +570,74 @@ spec_test!(ends_with_no_match);
572570
spec_test!(resolve_with_apply_true);
573571
spec_test!(resolve_with_apply_true_empty_result);
574572
spec_test!(resolve_with_apply_true_no_match);
573+
574+
// Is-null / is-not-null
575+
spec_test!(is_null_explicit);
576+
spec_test!(is_null_implicit);
577+
spec_test!(is_null_non_null_value);
578+
spec_test!(is_not_null_with_value);
579+
spec_test!(is_not_null_missing);
580+
581+
// NOT any rule
582+
spec_test!(not_any_no_overlap);
583+
spec_test!(not_any_has_overlap);
584+
spec_test!(not_any_empty_list);
585+
spec_test!(not_any_null_list);
586+
spec_test!(not_any_missing_field);
587+
588+
// NOT all rule
589+
spec_test!(not_all_some_outside);
590+
spec_test!(not_all_all_inside);
591+
spec_test!(not_all_empty_list);
592+
spec_test!(not_all_null_list);
593+
spec_test!(not_all_missing_field);
594+
595+
// ALL rule edge cases
596+
spec_test!(all_rule_empty_list);
597+
spec_test!(all_rule_null_list);
598+
spec_test!(all_rule_missing_field);
599+
spec_test!(all_rule_heterogeneous);
600+
601+
// ANY rule edge cases
602+
spec_test!(any_rule_empty_list);
603+
spec_test!(any_rule_null_list);
604+
spec_test!(any_rule_missing_field);
605+
spec_test!(any_rule_nested_list);
606+
607+
// Context value as list
608+
spec_test!(set_with_input_list);
609+
spec_test!(eq_with_input_list);
610+
spec_test!(range_with_input_list);
611+
612+
// Custom targeting key selector
613+
spec_test!(custom_key_match);
614+
spec_test!(custom_key_missing);
615+
spec_test!(custom_key_wrong_type);
616+
617+
// Semver targeting
618+
spec_test!(semver_match);
619+
spec_test!(semver_no_match);
620+
621+
// Timestamp targeting
622+
spec_test!(timestamp_match);
623+
spec_test!(timestamp_no_match);
624+
spec_test!(timestamp_bad_value);
625+
626+
// Targeting key + rollout edge cases
627+
spec_test!(full_rollout_invalid_key_type);
628+
spec_test!(partial_rollout_invalid_key_type);
629+
630+
// Segment edge cases
631+
spec_test!(same_segment_twice);
632+
spec_test!(fallthrough_single_rule);
633+
634+
// Materialized segment criterion
635+
spec_test!(mat_criterion_no_match);
636+
spec_test!(nested_mat_match);
637+
spec_test!(nested_mat_no_match);
638+
639+
// Combined criteria (attribute + materialized segment)
640+
spec_test!(combined_both_match);
641+
spec_test!(combined_only_attr);
642+
spec_test!(combined_only_mat);
643+
spec_test!(combined_neither);

0 commit comments

Comments
 (0)