mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2024-11-09 20:44:03 -08:00
fix: remove incorrect percentage indicator
This commit is contained in:
parent
9b9405978e
commit
2791b180b2
|
@ -67,7 +67,7 @@
|
|||
"charged_color": "#4caf50",
|
||||
"charging_color": "#40c4ff",
|
||||
"discharging_color": "#ff5722",
|
||||
"postfix": "% "
|
||||
"postfix": " "
|
||||
}
|
||||
},
|
||||
{
|
||||
|
|
|
@ -38,7 +38,7 @@ func (b *batt) string() string {
|
|||
return "BATT ERR"
|
||||
}
|
||||
batteryPercentage := bt.Current / bt.Full * 100
|
||||
percentageText := fmt.Sprintf("%.0f%%", batteryPercentage)
|
||||
percentageText := fmt.Sprintf("%.0f", batteryPercentage)
|
||||
var icon string
|
||||
var colorPorperty Property
|
||||
switch bt.State {
|
||||
|
|
|
@ -39,7 +39,7 @@ func TestBatteryCharging(t *testing.T) {
|
|||
},
|
||||
}
|
||||
b := setupBatteryTests(battery.Charging, 80, props)
|
||||
assert.Equal(t, "charging 80%", b.string())
|
||||
assert.Equal(t, "charging 80", b.string())
|
||||
}
|
||||
|
||||
func TestBatteryCharged(t *testing.T) {
|
||||
|
@ -49,7 +49,7 @@ func TestBatteryCharged(t *testing.T) {
|
|||
},
|
||||
}
|
||||
b := setupBatteryTests(battery.Full, 100, props)
|
||||
assert.Equal(t, "charged 100%", b.string())
|
||||
assert.Equal(t, "charged 100", b.string())
|
||||
}
|
||||
|
||||
func TestBatteryDischarging(t *testing.T) {
|
||||
|
@ -59,7 +59,7 @@ func TestBatteryDischarging(t *testing.T) {
|
|||
},
|
||||
}
|
||||
b := setupBatteryTests(battery.Discharging, 70, props)
|
||||
assert.Equal(t, "going down 70%", b.string())
|
||||
assert.Equal(t, "going down 70", b.string())
|
||||
}
|
||||
|
||||
func TestBatteryBackgroundColor(t *testing.T) {
|
||||
|
|
Loading…
Reference in a new issue