Test scanning upper case hex digits

This commit is contained in:
Sven Weidauer 2020-12-31 19:49:04 +01:00
parent b1adcb158e
commit 0991ca01ed

View file

@ -8,6 +8,12 @@ final class ColorParserTest: XCTestCase {
XCTAssertEqual(Color(red: 0xAA, green: 0xBB, blue: 0xCC), color) XCTAssertEqual(Color(red: 0xAA, green: 0xBB, blue: 0xCC), color)
} }
func testScanningThreeDigitColorUppercase() throws {
let scanner = Scanner(string: "#ABc")
let color = scanner.color()
XCTAssertEqual(Color(red: 0xAA, green: 0xBB, blue: 0xCC), color)
}
func testScanningFourDigitColor() throws { func testScanningFourDigitColor() throws {
let scanner = Scanner(string: "#abcd") let scanner = Scanner(string: "#abcd")
let color = scanner.color() let color = scanner.color()