test/hexapdf/test_dictionary.rb in hexapdf-0.9.3 vs test/hexapdf/test_dictionary.rb in hexapdf-0.10.0

- old
+ new

@@ -228,9 +228,18 @@ @obj.value[:Inherited] = HexaPDF::Object.new(:symbol) assert(@obj.validate(auto_correct: false)) @obj.value[:Inherited] = Class.new(Array).new([5]) assert(@obj.validate(auto_correct: false)) + + @test_class.define_field(:StringField, type: String) + @test_class.define_field(:NameField, type: Symbol) + @obj.value[:StringField] = :symbol + refute(@obj.validate(auto_correct: false)) + assert(@obj.validate(auto_correct: true)) + @obj.value[:NameField] = "string" + assert(@obj.validate(auto_correct: true)) + assert(@obj.validate(auto_correct: true)) end it "checks whether a field needs to be indirect w/wo auto_correct" do @obj.value[:Inherited] = HexaPDF::Object.new(:test, oid: 1) refute(@obj.validate(auto_correct: false))