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:
FuelBoard Contributor
2026-08-14 18:14:10 +01:00
parent fd7fa5f9c9
commit 80113456ae
7 changed files with 76 additions and 33 deletions
@@ -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() {