Skip to content

Commit 4d6f86d

Browse files
authored
Remove wrong tests violating the precondition and the assertion (#688)
* Remove wrong tests violating the precondition The precondition of `RTYPEDDATA_P` is the argument is `RUBY_T_DATA`. https://github.com/ruby/ruby/blob/ruby_3_1/include/ruby/internal/core/rtypeddata.h#L537 ``` * @pre `obj` must be a Ruby object of ::RUBY_T_DATA. ``` Must not call with non-data object, such as `Object` or `String`. * feat: update to Ruby 4.0 release
1 parent f881c4e commit 4d6f86d

File tree

2 files changed

+2
-25
lines changed

2 files changed

+2
-25
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ jobs:
5959
fail-fast: false
6060
matrix:
6161
# Test against all versions supported by rubygems
62-
ruby_version: ["2.7", "3.0", "3.1", "3.2", "3.3", "3.4", "4.0.0-preview2"]
62+
ruby_version: ["2.7", "3.0", "3.1", "3.2", "3.3", "3.4", "4.0"]
6363
sys:
6464
- os: ubuntu-latest
6565
rust_toolchain: ${{ needs.fetch_ci_data.outputs.minimum-supported-rust-version }}
@@ -108,8 +108,7 @@ jobs:
108108
sys:
109109
os: windows-2022
110110
rust_toolchain: stable
111-
# Ruby 4.0 not available on Windows yet
112-
- ruby_version: "4.0.0-preview2"
111+
- ruby_version: "4.0"
113112
sys:
114113
os: windows-2025
115114
rust_toolchain: stable

crates/rb-sys-tests/src/stable_api_test.rs

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,6 @@ fn gen_non_embedded_typed_data() -> VALUE {
6161
ruby_eval!("require 'stringio'; StringIO.new('a' * 1000)")
6262
}
6363

64-
fn gen_non_typed_data() -> VALUE {
65-
ruby_eval!("Object.new")
66-
}
67-
6864
parity_test!(
6965
name: test_rstring_len_basic,
7066
func: rstring_len,
@@ -681,24 +677,6 @@ parity_test! (
681677
expected: true
682678
);
683679

684-
parity_test! (
685-
name: test_rtypeddata_p_for_regular_data,
686-
func: rtypeddata_p,
687-
data_factory: {
688-
gen_non_typed_data()
689-
},
690-
expected: false
691-
);
692-
693-
parity_test! (
694-
name: test_rtypeddata_p_for_string,
695-
func: rtypeddata_p,
696-
data_factory: {
697-
gen_rstring!("not a typed data")
698-
},
699-
expected: false
700-
);
701-
702680
parity_test! (
703681
name: test_rtypeddata_embedded_p_for_typed_data,
704682
func: rtypeddata_embedded_p,

0 commit comments

Comments
 (0)