chore: import official kitty sources from upstream
Bring the kovidgoyal/kitty codebase in as the base of FWS-Kitty, vendored at upstream commit 91fb38a without its git history.
This commit is contained in:
1134 files changed
+433629
No files matched your search
@@ -0,0 +1,27 @@
|
||||
// License: GPLv3 Copyright: 2026, kitty contributors
|
||||
|
||||
package at
|
||||
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestParseOpacity(t *testing.T) {
|
||||
valid := map[string]float64{
|
||||
"0.5": 0.5, "0": 0, "1": 1, "2": 1, "-1": 0, "inf": 1, "-inf": 0,
|
||||
}
|
||||
for arg, expected := range valid {
|
||||
actual, err := parse_opacity(arg)
|
||||
if err != nil {
|
||||
t.Fatalf("parse_opacity(%#v) failed with error: %s", arg, err)
|
||||
}
|
||||
if actual != expected {
|
||||
t.Fatalf("parse_opacity(%#v) = %v != %v", arg, actual, expected)
|
||||
}
|
||||
}
|
||||
for _, arg := range []string{"oops", "", "nan", "NaN", "0.5x"} {
|
||||
if actual, err := parse_opacity(arg); err == nil {
|
||||
t.Fatalf("parse_opacity(%#v) accepted an invalid number and returned: %v", arg, actual)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user