diff --git a/spec/ruby_header_parser/parser_spec.rb b/spec/ruby_header_parser/parser_spec.rb index bab40ce..fd3dd63 100644 --- a/spec/ruby_header_parser/parser_spec.rb +++ b/spec/ruby_header_parser/parser_spec.rb @@ -276,6 +276,9 @@ context "rb_scan_args_set" do subject { definitions.find { |d| d.name == "rb_scan_args_set" } } + # Pre-C23 preprocessors may expand bool from to _Bool. + let(:bool_type) { match(/\A(?:bool|_Bool)\z/) } + let(:args) do [ argument(type: "int", name: "kw_flag"), @@ -284,9 +287,9 @@ argument(type: "int", name: "n_lead"), argument(type: "int", name: "n_opt"), argument(type: "int", name: "n_trail"), - argument(type: "_Bool", name: "f_var"), - argument(type: "_Bool", name: "f_hash"), - argument(type: "_Bool", name: "f_block"), + have_attributes(type: bool_type, name: "f_var", pointer: nil, length: 0), + have_attributes(type: bool_type, name: "f_hash", pointer: nil, length: 0), + have_attributes(type: bool_type, name: "f_block", pointer: nil, length: 0), argument(type: "VALUE", name: "vars", pointer: :ref_array), argument(type: "char", name: "fmt", pointer: :ref), argument(type: "int", name: "varc"), @@ -296,7 +299,7 @@ its(:name) { should eq "rb_scan_args_set" } its(:definition) { should eq "rb_scan_args_set(int kw_flag, int argc, const VALUE *argv," } # TODO: Fix this after its(:typeref) { should eq typeref(type: "int") } - its(:args) { should eq args } + its(:args) { should match args } end context "RSTRING_END" do