From 0991ca01edd64c30cd59aee838fe65e1b9acff23 Mon Sep 17 00:00:00 2001 From: Sven Weidauer Date: Thu, 31 Dec 2020 19:49:04 +0100 Subject: [PATCH] Test scanning upper case hex digits --- Tests/MakeColorsTests/ColorParserTest.swift | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Tests/MakeColorsTests/ColorParserTest.swift b/Tests/MakeColorsTests/ColorParserTest.swift index 86e8e4d..4a8a5e5 100644 --- a/Tests/MakeColorsTests/ColorParserTest.swift +++ b/Tests/MakeColorsTests/ColorParserTest.swift @@ -8,6 +8,12 @@ final class ColorParserTest: XCTestCase { 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 { let scanner = Scanner(string: "#abcd") let color = scanner.color()