Normalize Line Breaks
This commit is contained in:
		
							parent
							
								
									045ef3230b
								
							
						
					
					
						commit
						5f3610ecfd
					
				
					 1 changed files with 6 additions and 6 deletions
				
			
		| 
						 | 
				
			
			@ -124,19 +124,19 @@ describe("V2XmlFormatter", () => {
 | 
			
		|||
});
 | 
			
		||||
 | 
			
		||||
function testFormatter(xmlFormatter: XmlFormatter, options: XmlFormattingOptions, fileLabel: string): void {
 | 
			
		||||
    const expectedFormattedXml = TestDataLoader.load(`${fileLabel}.formatted.xml`);
 | 
			
		||||
    const unformattedXml = TestDataLoader.load(`${fileLabel}.unformatted.xml`);
 | 
			
		||||
    const expectedFormattedXml = TestDataLoader.load(`${fileLabel}.formatted.xml`).replace(/\r/, "");
 | 
			
		||||
    const unformattedXml = TestDataLoader.load(`${fileLabel}.unformatted.xml`).replace(/\r/, "");
 | 
			
		||||
 | 
			
		||||
    const actualFormattedXml = xmlFormatter.formatXml(unformattedXml, options);
 | 
			
		||||
    const actualFormattedXml = xmlFormatter.formatXml(unformattedXml, options).replace(/\r/, "");
 | 
			
		||||
 | 
			
		||||
    assert.equal(actualFormattedXml, expectedFormattedXml, "Actual formatted XML does not match expected formatted XML.");
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function testMinifier(xmlFormatter: XmlFormatter, options: XmlFormattingOptions, fileLabel: string): void {
 | 
			
		||||
    const expectedMinifiedXml = TestDataLoader.load(`${fileLabel}.minified.xml`);
 | 
			
		||||
    const unminifiedXml = TestDataLoader.load(`${fileLabel}.unminified.xml`);
 | 
			
		||||
    const expectedMinifiedXml = TestDataLoader.load(`${fileLabel}.minified.xml`).replace(/\r/, "");
 | 
			
		||||
    const unminifiedXml = TestDataLoader.load(`${fileLabel}.unminified.xml`).replace(/\r/, "");
 | 
			
		||||
 | 
			
		||||
    const actualMinifiedXml = xmlFormatter.minifyXml(unminifiedXml, options);
 | 
			
		||||
    const actualMinifiedXml = xmlFormatter.minifyXml(unminifiedXml, options).replace(/\r/, "");
 | 
			
		||||
 | 
			
		||||
    assert.equal(actualMinifiedXml, expectedMinifiedXml, "Actual minified XML does not match expected minified XML.");
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue