Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions spec/ruby_header_parser/parser_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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 <stdbool.h> to _Bool.
let(:bool_type) { match(/\A(?:bool|_Bool)\z/) }

let(:args) do
[
argument(type: "int", name: "kw_flag"),
Expand All @@ -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"),
Expand All @@ -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
Expand Down