mirror of
				https://github.com/ruby/ruby.git
				synced 2022-11-09 12:17:21 -05:00 
			
		
		
		
	Add tests of the encoding with BOM
This commit is contained in:
		
							parent
							
								
									f42588f754
								
							
						
					
					
						commit
						a8ef498d6b
					
				
					 1 changed files with 4 additions and 4 deletions
				
			
		| 
						 | 
				
			
			@ -2089,11 +2089,11 @@ EOT
 | 
			
		|||
        content = text.encode(name)
 | 
			
		||||
        generate_file(path, content)
 | 
			
		||||
        result = File.read(path, mode: 'rb:BOM|UTF-8')
 | 
			
		||||
        assert_equal(content[1].force_encoding("ascii-8bit"),
 | 
			
		||||
                     result.force_encoding("ascii-8bit"))
 | 
			
		||||
        assert_equal(Encoding.find(name), result.encoding, name)
 | 
			
		||||
        assert_equal(content[1..-1].b, result.b, name)
 | 
			
		||||
        result = File.read(path, mode: 'rb:BOM|UTF-8:UTF-8')
 | 
			
		||||
        assert_equal(Encoding::UTF_8, result.encoding)
 | 
			
		||||
        assert_equal(stripped, result)
 | 
			
		||||
        assert_equal(Encoding::UTF_8, result.encoding, name)
 | 
			
		||||
        assert_equal(stripped, result, name)
 | 
			
		||||
      end
 | 
			
		||||
 | 
			
		||||
      bug3407 = '[ruby-core:30641]'
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue