Price display: station sign drops the £ (134.9) — matches roadside signs; pounds & pence uses forecourt superscript style £1.29⁹/L (small superscript third digit, small /L); attributed Text on list/widgets/Live Activity, Unicode superscript in Siri cards
This commit is contained in:
@@ -566,15 +566,18 @@ final class SiriCheapestLookupTests: XCTestCase {
|
||||
|
||||
final class PriceDisplayTests: XCTestCase {
|
||||
func testStationSignStyle() {
|
||||
XCTAssertEqual(FuelStore.priceText(129.9, style: .stationSign), "£129.9")
|
||||
XCTAssertEqual(FuelStore.priceText(135.0, style: .stationSign), "£135.0")
|
||||
XCTAssertEqual(FuelStore.priceText(249.9, style: .stationSign), "£249.9")
|
||||
// Bare pence figure, no £ — exactly the roadside sign.
|
||||
XCTAssertEqual(FuelStore.priceText(129.9, style: .stationSign), "129.9")
|
||||
XCTAssertEqual(FuelStore.priceText(135.0, style: .stationSign), "135.0")
|
||||
XCTAssertEqual(FuelStore.priceText(249.9, style: .stationSign), "249.9")
|
||||
}
|
||||
|
||||
func testPoundsPenceStyle() {
|
||||
XCTAssertEqual(FuelStore.priceText(129.9, style: .poundsPence), "£1.299")
|
||||
XCTAssertEqual(FuelStore.priceText(135.0, style: .poundsPence), "£1.350")
|
||||
XCTAssertEqual(FuelStore.priceText(100.9, style: .poundsPence), "£1.009")
|
||||
// Forecourt superscript style: £ + 2dp + small superscript third digit + /L.
|
||||
XCTAssertEqual(FuelStore.priceText(129.9, style: .poundsPence), "£1.29⁹/L")
|
||||
XCTAssertEqual(FuelStore.priceText(135.0, style: .poundsPence), "£1.35⁰/L")
|
||||
XCTAssertEqual(FuelStore.priceText(100.9, style: .poundsPence), "£1.00⁹/L")
|
||||
XCTAssertEqual(FuelStore.priceText(199.9, style: .poundsPence), "£1.99⁹/L")
|
||||
}
|
||||
|
||||
func testSpokenAlwaysPounds() {
|
||||
|
||||
Reference in New Issue
Block a user