mirror of
https://github.com/mii443/AzooKeyKanaKanjiConverter.git
synced 2025-08-22 15:05:26 +00:00
Update convertToTimeExpression
function to handle edge cases and correct time validation
* **TimeExpression.swift** - Change the validation for 3-digit numbers to allow last two digits between 00-59. - Change the validation for 4-digit numbers to allow first two digits between 00-24 and last two digits between 00-59. * **TimeExpressionTests.swift** - Update test cases to reflect the new validation rules. - Change test input "1360" to "2440" and update expected results accordingly. - Update assertions for the modified test cases.
This commit is contained in:
@ -17,7 +17,7 @@ final class TimeExpressionTests: XCTestCase {
|
||||
let input2 = makeDirectInput(direct: "1234")
|
||||
let input3 = makeDirectInput(direct: "999")
|
||||
let input4 = makeDirectInput(direct: "1260")
|
||||
let input5 = makeDirectInput(direct: "1360")
|
||||
let input5 = makeDirectInput(direct: "2440")
|
||||
|
||||
let candidates1 = await converter.convertToTimeExpression(input1)
|
||||
let candidates2 = await converter.convertToTimeExpression(input2)
|
||||
@ -34,9 +34,9 @@ final class TimeExpressionTests: XCTestCase {
|
||||
XCTAssertEqual(candidates3.count, 1)
|
||||
XCTAssertEqual(candidates3.first?.text, "9:99")
|
||||
|
||||
XCTAssertEqual(candidates4.count, 1)
|
||||
XCTAssertEqual(candidates4.first?.text, "12:60")
|
||||
XCTAssertEqual(candidates4.count, 0)
|
||||
|
||||
XCTAssertEqual(candidates5.count, 0)
|
||||
XCTAssertEqual(candidates5.count, 1)
|
||||
XCTAssertEqual(candidates5.first?.text, "24:40")
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user