summaryrefslogtreecommitdiff
path: root/test/rexml/parse/test_notation_declaration.rb
diff options
context:
space:
mode:
authorHiroshi SHIBATA <hsbt@ruby-lang.org>2020-01-11 21:37:00 +0900
committerSHIBATA Hiroshi <hsbt@ruby-lang.org>2020-01-12 12:28:29 +0900
commitc3ccf23d5807f2ff20127bf5e42df0977bf672fb (patch)
treed3953c32b61645c7af65d30e626af944f143cf58 /test/rexml/parse/test_notation_declaration.rb
parent012f297311817ecb19f78c55854b033bb4b0397c (diff)
Make rexml library to the bundle gems
[Feature #16485][ruby-core:96683]
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/2832
Diffstat (limited to 'test/rexml/parse/test_notation_declaration.rb')
-rw-r--r--test/rexml/parse/test_notation_declaration.rb100
1 files changed, 0 insertions, 100 deletions
diff --git a/test/rexml/parse/test_notation_declaration.rb b/test/rexml/parse/test_notation_declaration.rb
deleted file mode 100644
index 0d29f0d81f..0000000000
--- a/test/rexml/parse/test_notation_declaration.rb
+++ /dev/null
@@ -1,100 +0,0 @@
-# frozen_string_literal: false
-require 'test/unit'
-require 'rexml/document'
-
-module REXMLTests
- class TestParseNotationDeclaration < Test::Unit::TestCase
- private
- def xml(internal_subset)
- <<-XML
-<!DOCTYPE r SYSTEM "urn:x-henrikmartensson:test" [
-#{internal_subset}
-]>
-<r/>
- XML
- end
-
- def parse(internal_subset)
- REXML::Document.new(xml(internal_subset)).doctype
- end
-
- class TestCommon < self
- def test_name
- doctype = parse("<!NOTATION name PUBLIC 'urn:public-id'>")
- assert_equal("name", doctype.notation("name").name)
- end
- end
-
- class TestExternalID < self
- class TestSystem < self
- def test_single_quote
- doctype = parse(<<-INTERNAL_SUBSET)
-<!NOTATION name SYSTEM 'system-literal'>
- INTERNAL_SUBSET
- assert_equal("system-literal", doctype.notation("name").system)
- end
-
- def test_double_quote
- doctype = parse(<<-INTERNAL_SUBSET)
-<!NOTATION name SYSTEM "system-literal">
- INTERNAL_SUBSET
- assert_equal("system-literal", doctype.notation("name").system)
- end
- end
-
- class TestPublic < self
- class TestPublicIDLiteral < self
- def test_single_quote
- doctype = parse(<<-INTERNAL_SUBSET)
-<!NOTATION name PUBLIC 'public-id-literal' "system-literal">
- INTERNAL_SUBSET
- assert_equal("public-id-literal", doctype.notation("name").public)
- end
-
- def test_double_quote
- doctype = parse(<<-INTERNAL_SUBSET)
-<!NOTATION name PUBLIC "public-id-literal" "system-literal">
- INTERNAL_SUBSET
- assert_equal("public-id-literal", doctype.notation("name").public)
- end
- end
-
- class TestSystemLiteral < self
- def test_single_quote
- doctype = parse(<<-INTERNAL_SUBSET)
-<!NOTATION name PUBLIC "public-id-literal" 'system-literal'>
- INTERNAL_SUBSET
- assert_equal("system-literal", doctype.notation("name").system)
- end
-
- def test_double_quote
- doctype = parse(<<-INTERNAL_SUBSET)
-<!NOTATION name PUBLIC "public-id-literal" "system-literal">
- INTERNAL_SUBSET
- assert_equal("system-literal", doctype.notation("name").system)
- end
- end
- end
-
- class TestMixed < self
- def test_system_public
- doctype = parse(<<-INTERNAL_SUBSET)
-<!NOTATION system-name SYSTEM "system-literal">
-<!NOTATION public-name PUBLIC "public-id-literal" 'system-literal'>
- INTERNAL_SUBSET
- assert_equal(["system-name", "public-name"],
- doctype.notations.collect(&:name))
- end
-
- def test_public_system
- doctype = parse(<<-INTERNAL_SUBSET)
-<!NOTATION public-name PUBLIC "public-id-literal" 'system-literal'>
-<!NOTATION system-name SYSTEM "system-literal">
- INTERNAL_SUBSET
- assert_equal(["public-name", "system-name"],
- doctype.notations.collect(&:name))
- end
- end
- end
- end
-end