mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2024-11-09 20:44:03 -08:00
parent
c1bf3a16fe
commit
b5bb060641
4
.vscode/launch.json
vendored
4
.vscode/launch.json
vendored
|
@ -12,7 +12,9 @@
|
|||
"print",
|
||||
"primary",
|
||||
"--shell=pwsh",
|
||||
"--terminal-width=200"
|
||||
"--terminal-width=200",
|
||||
"--execution-time=600",
|
||||
"--config=/Users/jan/.posh.omp.json"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
|
|
@ -7,6 +7,9 @@ func interFaceToInt(e interface{}) int {
|
|||
if val, OK := e.(float64); OK {
|
||||
return int(val)
|
||||
}
|
||||
if val, OK := e.(int64); OK {
|
||||
return int(val)
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
|
@ -17,6 +20,9 @@ func interfaceToFloat64(e interface{}) float64 {
|
|||
if val, OK := e.(int); OK {
|
||||
return float64(val)
|
||||
}
|
||||
if val, OK := e.(int64); OK {
|
||||
return float64(val)
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
|
@ -31,5 +37,5 @@ func gt(e1, e2 interface{}) bool {
|
|||
}
|
||||
|
||||
func lt(e1, e2 interface{}) bool {
|
||||
return !gt(e1, e2)
|
||||
return gt(e2, e1)
|
||||
}
|
||||
|
|
|
@ -16,6 +16,7 @@ func TestGt(t *testing.T) {
|
|||
{Case: "Float vs int", Expected: false, E1: float64(3), E2: 4},
|
||||
{Case: "Int vs float", Expected: false, E1: 3, E2: float64(4)},
|
||||
{Case: "Int vs Int", Expected: false, E1: 3, E2: 4},
|
||||
{Case: "Int64 vs Int", Expected: false, E1: int64(3), E2: 4},
|
||||
{Case: "Float vs Float", Expected: false, E1: float64(3), E2: float64(4)},
|
||||
{Case: "Float vs String", Expected: true, E1: float64(3), E2: "test"},
|
||||
{Case: "Int vs String", Expected: true, E1: 3, E2: "test"},
|
||||
|
@ -40,7 +41,7 @@ func TestLt(t *testing.T) {
|
|||
{Case: "Int vs Int", Expected: true, E1: 3, E2: 4},
|
||||
{Case: "Float vs Float", Expected: true, E1: float64(3), E2: float64(4)},
|
||||
{Case: "Float vs String", Expected: false, E1: float64(3), E2: "test"},
|
||||
{Case: "String vs String", Expected: true, E1: "test", E2: "test"},
|
||||
{Case: "String vs String", Expected: false, E1: "test", E2: "test"},
|
||||
}
|
||||
|
||||
for _, tc := range cases {
|
||||
|
|
Loading…
Reference in a new issue