Skip to content

Commit 233d91d

Browse files
committed
test(oracle): add strict combo probes (batch 115), hex-float/print-escape/char-table-defalt/decode-encode-time-list/subr-print at parity
One new divergence_combo_strict_* probe file (5 tests) for hex float format (%a/%A on 1.5/0.0/-1.0/3.14159/inf), print-escape-control-characters (control chars 7/8/9/10/13/27 in prin1), char-table :defalt and parent chain (child inherits parent entries, default value fallback), decode/encode-time list form (decoded-time list as input), and subr/compiled function print forms (car/+ as subr, mapcar as compiled). 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 21db983 commit 233d91d

2 files changed

Lines changed: 92 additions & 0 deletions

File tree

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
//! Strict combo oracle probes, batch 115: hex float format (%a/%A),
2+
//! print-escape-control-characters, char-table :defalt, decode/encode-time
3+
//! list form, and subr prin1 form.
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_s9_hex_float_format_a_A() {
12+
return_if_neovm_enable_oracle_proptest_not_set!();
13+
assert_oracle_parity(
14+
r####"
15+
(list (condition-case err (format "%a" 1.5) (error (car err)))
16+
(condition-case err (format "%A" 1.5) (error (car err)))
17+
(condition-case err (format "%a" 0.0) (error (car err)))
18+
(condition-case err (format "%a" -1.0) (error (car err)))
19+
(condition-case err (format "%a" 3.14159) (error (car err)))
20+
(condition-case err (format "%a" (/ 1.0 0.0)) (error (car err))))
21+
"####,
22+
);
23+
}
24+
25+
#[test]
26+
fn div_s9_print_escape_control_characters() {
27+
return_if_neovm_enable_oracle_proptest_not_set!();
28+
assert_oracle_parity(
29+
r####"
30+
(let ((s (string 7 8 9 10 13 27 65)))
31+
(list (let ((print-escape-control-characters t)) (prin1-to-string s))
32+
(let ((print-escape-control-characters nil)) (prin1-to-string s))
33+
(let ((print-escape-newlines t)) (prin1-to-string (string 10 13)))
34+
(let ((print-escape-control-characters t)
35+
(print-escape-newlines t))
36+
(prin1-to-string (string 9 10 7 8 13 27)))))
37+
"####,
38+
);
39+
}
40+
41+
#[test]
42+
fn div_s9_char_table_defalt_and_parent() {
43+
return_if_neovm_enable_oracle_proptest_not_set!();
44+
assert_oracle_parity(
45+
r####"
46+
(let* ((parent (make-char-table 'syntax-table 'parent-default))
47+
(child (make-char-table 'syntax-table 'child-default)))
48+
(set-char-table-parent child parent)
49+
(aset parent ?a 'parent-a)
50+
(aset child ?b 'child-b)
51+
(list (char-table-range parent ?a)
52+
(char-table-range parent ?b)
53+
(char-table-range parent ?z)
54+
(char-table-range child ?a)
55+
(char-table-range child ?b)
56+
(char-table-range child ?c)
57+
(char-table-range child nil)
58+
(char-table-parent child)))
59+
"####,
60+
);
61+
}
62+
63+
#[test]
64+
fn div_s9_decode_encode_time_list_form() {
65+
return_if_neovm_enable_oracle_proptest_not_set!();
66+
assert_oracle_parity(
67+
r####"
68+
(list (decode-time '(0 0 0 1 1 2000))
69+
(decode-time '(30 45 12 15 6 2025) 0)
70+
(encode-time '(0 0 0 1 1 2000))
71+
(encode-time '(30 0 12 1 1 1970))
72+
(encode-time '(59 59 23 31 12 1999) 0))
73+
"####,
74+
);
75+
}
76+
77+
#[test]
78+
fn div_s9_subr_and_compiled_print_forms() {
79+
return_if_neovm_enable_oracle_proptest_not_set!();
80+
assert_oracle_parity(
81+
r####"
82+
(list (subrp (symbol-function 'car))
83+
(subrp (symbol-function '+))
84+
(condition-case err (format "%s" (symbol-function 'car))
85+
(error (cons 'err (car err))))
86+
(string-match "subr" (format "%s" (symbol-function 'car)))
87+
(compiled-function-p (symbol-function 'mapcar))
88+
(string-match "closure\\|lambda\\|compiled" (format "%s" (symbol-function 'mapcar))))
89+
"####,
90+
);
91+
}

neovm-oracle-tests/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2333,6 +2333,7 @@ mod divergence_combo_strict_executable_fringe_isotransl_hideshow;
23332333
mod divergence_combo_strict_face_attribute_weight_canonicalization;
23342334
mod divergence_combo_strict_faceremap_textscale_history_mailcap_syntaxpp;
23352335
mod divergence_combo_strict_filename_backup_substitute_remote;
2336+
mod divergence_combo_strict_float_hex_format_print_escape_control_char_table_defalt;
23362337
mod divergence_combo_strict_font_attribute_canonicalization_deep;
23372338
mod divergence_combo_strict_font_terminal_chartab_window;
23382339
mod divergence_combo_strict_font_xlfd_faceattrs_codingsys_plist;

0 commit comments

Comments
 (0)