utils.go: toInt() -> ToInt(); toBool() -> ToBool()

This commit is contained in:
2024-06-10 19:03:39 +02:00
parent 0bb4c96481
commit 9745a5d909
8 changed files with 24 additions and 24 deletions
+5 -5
View File
@@ -63,7 +63,7 @@ func TestIsString(t *testing.T) {
}
count++
b, ok := toBool(true)
b, ok := ToBool(true)
if !(ok && b) {
t.Errorf("%d: toBool(true) b=%v, ok=%v -> result = false, want true", count, b, ok)
failed++
@@ -72,7 +72,7 @@ func TestIsString(t *testing.T) {
}
count++
b, ok = toBool("abc")
b, ok = ToBool("abc")
if !(ok && b) {
t.Errorf("%d: toBool(\"abc\") b=%v, ok=%v -> result = false, want true", count, b, ok)
failed++
@@ -81,7 +81,7 @@ func TestIsString(t *testing.T) {
}
count++
b, ok = toBool([]int{})
b, ok = ToBool([]int{})
if ok {
t.Errorf("%d: toBool([]) b=%v, ok=%v -> result = true, want false", count, b, ok)
failed++
@@ -97,7 +97,7 @@ func TestToIntOk(t *testing.T) {
wantValue := int(64)
wantErr := error(nil)
gotValue, gotErr := toInt(source, "test")
gotValue, gotErr := ToInt(source, "test")
if gotErr != nil || gotValue != wantValue {
t.Errorf("toInt(%v, \"test\") gotValue=%v, gotErr=%v -> wantValue=%v, wantErr=%v",
@@ -110,7 +110,7 @@ func TestToIntErr(t *testing.T) {
wantValue := 0
wantErr := errors.New(`test expected integer, got uint64 (64)`)
gotValue, gotErr := toInt(source, "test")
gotValue, gotErr := ToInt(source, "test")
if gotErr.Error() != wantErr.Error() || gotValue != wantValue {
t.Errorf("toInt(%v, \"test\") gotValue=%v, gotErr=%v -> wantValue=%v, wantErr=%v",