Skip to content

Commit 21db983

Browse files
committed
test(oracle): add strict combo probes (batch 114), print-circle/gensym/read-circle/cl-assert/backquote-nested at parity
One new divergence_combo_strict_* probe file (5 tests) for print-circle with complex shared structure (same sublist referenced 3x), print-gensym (uninterned symbol printing with/without circle/gensym), read-circle backreferences (#1= and #1# in circular lists, vectors, and shared refs), cl-assert/cl-check-type/ cl-typecase/cl-etypecase (with error conditions), and backquote nested splicing (,@ with mapcar, nested backquote, multiple splices). All run via cargo nextest with NEOVM_ORACLE_MODE=live. All 5 are parity locks. cargo fmt --all and cargo check --workspace are clean.
1 parent d931c6e commit 21db983

2 files changed

Lines changed: 87 additions & 0 deletions

File tree

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
//! Strict combo oracle probes, batch 114: print-circle with complex shared
2+
//! structure, print-gensym (uninterned symbol printing), read-circle
3+
//! backreferences (#N= and #N#), and cl-assert/cl-check-type/cl-etypecase.
4+
//!
5+
//! Tests are parity locks unless annotated with a surfaced divergence.
6+
7+
use super::common::assert_oracle_parity;
8+
use super::common::return_if_neovm_enable_oracle_proptest_not_set;
9+
10+
#[test]
11+
fn div_s8_print_circle_complex_shared() {
12+
return_if_neovm_enable_oracle_proptest_not_set!();
13+
assert_oracle_parity(
14+
r####"
15+
(let* ((shared (list 1 2))
16+
(tree (list shared shared shared)))
17+
(list (let ((print-circle nil)) (prin1-to-string tree))
18+
(let ((print-circle t)) (prin1-to-string tree))))
19+
"####,
20+
);
21+
}
22+
23+
#[test]
24+
fn div_s8_print_gensym_uninterned() {
25+
return_if_neovm_enable_oracle_proptest_not_set!();
26+
assert_oracle_parity(
27+
r####"
28+
(let ((s (make-symbol "probe-gensym")))
29+
(list (let ((print-gensym t)) (prin1-to-string s))
30+
(let ((print-gensym nil)) (prin1-to-string s))
31+
(let ((print-circle t) (print-gensym t)) (prin1-to-string (list s s)))))
32+
"####,
33+
);
34+
}
35+
36+
#[test]
37+
fn div_s8_read_circle_backreferences() {
38+
return_if_neovm_enable_oracle_proptest_not_set!();
39+
assert_oracle_parity(
40+
r####"
41+
(list (read "#1=(a b . #1#)")
42+
(read "(#1=(x y) #1#)")
43+
(read "#1=[1 2 #1#]")
44+
(let ((obj (read "#1=(a . b) (test . #1#)")))
45+
obj))
46+
"####,
47+
);
48+
}
49+
50+
#[test]
51+
fn div_s8_cl_assert_check_type_etypecase() {
52+
return_if_neovm_enable_oracle_proptest_not_set!();
53+
assert_oracle_parity(
54+
r####"
55+
(list (condition-case err (cl-assert t) (error (car err)))
56+
(condition-case err (cl-assert nil nil "probe-fail") (error (cadr err)))
57+
(condition-case err (cl-check-type 42 integer) (error (car err)))
58+
(condition-case err (cl-check-type "x" integer) (error (car err)))
59+
(cl-typecase 42
60+
(integer 'int)
61+
(string 'str))
62+
(cl-etypecase 42
63+
(integer 'int)
64+
(string 'str))
65+
(cl-etypecase "x"
66+
(integer 'int)
67+
(string 'str)))
68+
"####,
69+
);
70+
}
71+
72+
#[test]
73+
fn div_s8_backquote_nested_splicing() {
74+
return_if_neovm_enable_oracle_proptest_not_set!();
75+
assert_oracle_parity(
76+
r####"
77+
(let ((items '(a b c))
78+
(more '(d e)))
79+
(list `(start ,@items ,@more end)
80+
`(1 ,@(mapcar #'1+ '(1 2 3)) 4)
81+
`(outer ,`(inner ,(+ 1 2)))
82+
`(head ,@items tail ,@more)
83+
`(deep ,@(list 1 `(nested ,@more) 3))))
84+
"####,
85+
);
86+
}

neovm-oracle-tests/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2382,6 +2382,7 @@ mod divergence_combo_strict_newfixes_font_encoding_fileio;
23822382
mod divergence_combo_strict_object_print_coding;
23832383
mod divergence_combo_strict_occur_apropos_windmove;
23842384
mod divergence_combo_strict_overlay_priority_textprop_interaction_deep;
2385+
mod divergence_combo_strict_print_circle_gensym_read_backref_cl_assert_deep;
23852386
mod divergence_combo_strict_printprops_keymap_coding;
23862387
mod divergence_combo_strict_printquote_void_lexical_format;
23872388
mod divergence_combo_strict_process_sync_callproc_env;

0 commit comments

Comments
 (0)