Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

Commit

Permalink
Allow for different OS line ending encodings in StaticResources
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Ballinger committed Aug 30, 2023
1 parent dd9a4c5 commit 20b1208
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion force-app/main/default/classes/CsvToJsonConversionTest.cls
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public with sharing class CsvToJsonConversionTest {
System.assertNotEquals(null, c.MailingStreet);

if(c.FirstName=='Donette' && c.LastName=='Foller') {
System.assertEquals('34 Center St\n#42', c.MailingStreet);
Assert.isTrue(c.MailingStreet == '34 Center St\n#42' || c.MailingStreet == '34 Center St\r\n#42');
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion force-app/main/default/classes/CsvToObjectTest.cls
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ public with sharing class CsvToObjectTest {
Assert.isNotNull(c.Address);

if(c.FirstName=='Donette' && c.LastName=='Foller') {
Assert.areEqual('34 Center St\n#42', c.Address);
// The line ending characters of the OS that uploaded the StaticResource can affect the encoding
Assert.isTrue(c.Address == '34 Center St\n#42' || c.Address == '34 Center St\r\n#42');
}
}
}
Expand Down

0 comments on commit 20b1208

Please sign in to comment.