|
| 1 | +//! Strict combo oracle probes, batch 123: number formatting edges, char-width |
| 2 | +//! of unusual Unicode categories, mapconcat/delq/nthcdr edge cases, and |
| 3 | +//! marker in killed buffer. Uses assert_oracle_parity_expect format. |
| 4 | +
|
| 5 | +use super::common::return_if_neovm_enable_oracle_proptest_not_set; |
| 6 | + |
| 7 | +#[test] |
| 8 | +fn div_t7_number_format_extreme_edge() { |
| 9 | + return_if_neovm_enable_oracle_proptest_not_set!(); |
| 10 | + let form = r#" |
| 11 | +(list (number-to-string most-negative-fixnum) |
| 12 | + (format "%d" (1- most-negative-fixnum)) |
| 13 | + (format "%d" (expt 2 70)) |
| 14 | + (format "%o" 8) |
| 15 | + (format "%x" 255) |
| 16 | + (format "%X" 255) |
| 17 | + (format "%#o" 64) |
| 18 | + (format "%#x" 255) |
| 19 | + (format "%b" 10) |
| 20 | + (format "%+d" 0) |
| 21 | + (format "% d" 0) |
| 22 | + (format "%05.2f" 0) |
| 23 | + (format "%-10.3e|" 3.14159) |
| 24 | + (number-to-string -0.0) |
| 25 | + (format "%s" 1e20) |
| 26 | + (format "%g" 0.0001) |
| 27 | + (format "%g" 0.00001) |
| 28 | + (format "%.15g" (/ 1.0 7.0))) |
| 29 | +"#; |
| 30 | + let expect = expect_test::expect![[r#""""#]]; |
| 31 | + crate::common::assert_oracle_parity_expect(form, expect); |
| 32 | +} |
| 33 | + |
| 34 | +#[test] |
| 35 | +fn div_t7_char_width_unusual_unicode() { |
| 36 | + return_if_neovm_enable_oracle_proptest_not_set!(); |
| 37 | + let form = r#" |
| 38 | +(list (char-width 160) |
| 39 | + (char-width 173) |
| 40 | + (char-width 8203) |
| 41 | + (char-width 8204) |
| 42 | + (char-width 8205) |
| 43 | + (char-width 8237) |
| 44 | + (char-width 8238) |
| 45 | + (char-width 8288) |
| 46 | + (char-width 12288) |
| 47 | + (char-width 65279) |
| 48 | + (string-width (string 65 160 66)) |
| 49 | + (string-width "ab") |
| 50 | + (string-width "ab") |
| 51 | + (string-width "ab") |
| 52 | + (string-width (string 65 8237 66)) |
| 53 | + (string-width "a b")) |
| 54 | +"#; |
| 55 | + let expect = expect_test::expect![[r#""""#]]; |
| 56 | + crate::common::assert_oracle_parity_expect(form, expect); |
| 57 | +} |
| 58 | + |
| 59 | +#[test] |
| 60 | +fn div_t7_mapconcat_delq_nthcdr_edge() { |
| 61 | + return_if_neovm_enable_oracle_proptest_not_set!(); |
| 62 | + let form = r#" |
| 63 | +(list (mapconcat #'identity '() "-") |
| 64 | + (mapconcat #'identity '("a") "-") |
| 65 | + (mapconcat #'identity '("a" "b" "c") "") |
| 66 | + (mapconcat #'number-to-string '(1 2 3) ", ") |
| 67 | + (delq nil '(1 nil 2 nil 3)) |
| 68 | + (delq 'a '(a b a c a)) |
| 69 | + (remq 'a '(1 a 2 a 3)) |
| 70 | + (nthcdr 0 '(a b c)) |
| 71 | + (nthcdr 2 '(a b c)) |
| 72 | + (nthcdr 5 '(a b c)) |
| 73 | + (nthcdr 0 nil) |
| 74 | + (last '(a b c)) |
| 75 | + (last '(a b c) 2) |
| 76 | + (last nil) |
| 77 | + (butlast '(a b c d)) |
| 78 | + (butlast '(a b c d) 2)) |
| 79 | +"#; |
| 80 | + let expect = expect_test::expect![[r#""""#]]; |
| 81 | + crate::common::assert_oracle_parity_expect(form, expect); |
| 82 | +} |
| 83 | + |
| 84 | +#[test] |
| 85 | +fn div_t7_marker_killed_buffer() { |
| 86 | + return_if_neovm_enable_oracle_proptest_not_set!(); |
| 87 | + let form = r#" |
| 88 | +(let* ((b (generate-new-buffer " *probe-mk*")) |
| 89 | + (m (set-marker (make-marker) 3 b))) |
| 90 | + (list (marker-position m) |
| 91 | + (eq (marker-buffer m) b) |
| 92 | + (progn (kill-buffer b) |
| 93 | + (marker-position m)) |
| 94 | + (marker-buffer m) |
| 95 | + (markerp m) |
| 96 | + (progn (set-marker m 5) (marker-position m)))) |
| 97 | +"#; |
| 98 | + let expect = expect_test::expect![[r#""""#]]; |
| 99 | + crate::common::assert_oracle_parity_expect(form, expect); |
| 100 | +} |
| 101 | + |
| 102 | +#[test] |
| 103 | +fn div_t7_assq_delete_all_duplicates() { |
| 104 | + return_if_neovm_enable_oracle_proptest_not_set!(); |
| 105 | + let form = r#" |
| 106 | +(list (assq-delete-all 'a '((a . 1) (b . 2) (a . 3) (c . 4) (a . 5))) |
| 107 | + (assq-delete-all 'z '((a . 1) (b . 2))) |
| 108 | + (assoc-delete-all "a" '(("a" . 1) ("b" . 2) ("a" . 3))) |
| 109 | + (let ((al '((a . 1) (b . 2) (a . 3) (c . 4)))) |
| 110 | + (assq-delete-all 'a al)) |
| 111 | + (rassq-delete-all 2 '((a . 1) (b . 2) (c . 2) (d . 3)))) |
| 112 | +"#; |
| 113 | + let expect = expect_test::expect![[r#""""#]]; |
| 114 | + crate::common::assert_oracle_parity_expect(form, expect); |
| 115 | +} |
0 commit comments