diff --git a/.github/workflows/upstream.yml b/.github/workflows/upstream.yml index 20bf392300..1c63c8078a 100644 --- a/.github/workflows/upstream.yml +++ b/.github/workflows/upstream.yml @@ -6,6 +6,12 @@ on: workflow_dispatch: schedule: - cron: "0 8 * * 1,3,5" # At 08:00 on Monday, Wednesday, and Friday # https://crontab.guru/#0_8_*_*_1,3,5 + pull_request: + types: [opened, synchronize] + branches: + - '*' + paths: + - .github/workflows/upstream.yml # this file jobs: xmlsoft-head: @@ -94,7 +100,7 @@ jobs: fail-fast: false matrix: sys: ["enable", "disable"] - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 # warning that 22.04 binary has dwarf5 debug info that valgrind can't read steps: - uses: actions/checkout@v3 with: diff --git a/test/xml/test_reader.rb b/test/xml/test_reader.rb index 67f46c31c4..6d5060ae6c 100644 --- a/test/xml/test_reader.rb +++ b/test/xml/test_reader.rb @@ -684,7 +684,7 @@ def test_nonexistent_attribute def test_broken_markup_attribute_hash xml = <<~XML - + #{"x" * 1024} XML reader = Nokogiri::XML::Reader(xml) reader.read # root @@ -696,15 +696,18 @@ def test_broken_markup_attribute_hash if Nokogiri.jruby? assert_equal({ "bar" => "asdf" }, reader.attribute_hash) - reader.read # text + reader.read # text (xxxxx) + reader.read # text (newline) - assert_raises(Nokogiri::XML::SyntaxError) do + e = assert_raises(Nokogiri::XML::SyntaxError) do reader.read end + assert_includes(e.message, "XML document structures must start and end") else - assert_raises(Nokogiri::XML::SyntaxError) do + e = assert_raises(Nokogiri::XML::SyntaxError) do reader.attribute_hash end + assert_includes(e.message, "FATAL: Extra content at the end of the document") end assert_equal(1, reader.errors.length) @@ -712,7 +715,7 @@ def test_broken_markup_attribute_hash def test_broken_markup_namespaces xml = <<~XML - + #{"x" * 1024} XML reader = Nokogiri::XML::Reader(xml) reader.read # root @@ -724,15 +727,18 @@ def test_broken_markup_namespaces if Nokogiri.jruby? assert_equal({ "xmlns:quux" => "qwer" }, reader.namespaces) - reader.read # text + reader.read # text (xxxxx) + reader.read # text (newline) - assert_raises(Nokogiri::XML::SyntaxError) do + e = assert_raises(Nokogiri::XML::SyntaxError) do reader.read end + assert_includes(e.message, "XML document structures must start and end") else - assert_raises(Nokogiri::XML::SyntaxError) do + e = assert_raises(Nokogiri::XML::SyntaxError) do reader.namespaces end + assert_includes(e.message, "FATAL: Extra content at the end of the document") end assert_equal(1, reader.errors.length)