Skip to content

Commit

Permalink
cm: reduce test noise
Browse files Browse the repository at this point in the history
  • Loading branch information
ydnar committed Dec 28, 2024
1 parent 472bcf6 commit 921df28
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions cm/result_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package cm

import (
"fmt"
"runtime"
"testing"
"unsafe"
Expand Down Expand Up @@ -177,9 +176,9 @@ func TestIssue95String(t *testing.T) {
want := "hello"
res := OK[stringResult](want)
got := *res.OK()
fmt.Printf("unsafe.Sizeof(res): %d\n", unsafe.Sizeof(res))
fmt.Printf("got: %v (%d) want: %v (%d)\n",
unsafe.StringData(got), len(got), unsafe.StringData(want), len(want))
// fmt.Printf("unsafe.Sizeof(res): %d\n", unsafe.Sizeof(res))
// fmt.Printf("got: %v (%d) want: %v (%d)\n",
// unsafe.StringData(got), len(got), unsafe.StringData(want), len(want))
if got != want {
t.Errorf("*res.OK(): %v, expected %v", got, want)
}
Expand All @@ -196,8 +195,8 @@ func TestIssue95Uint64(t *testing.T) {
want := uint64(123)
res := OK[uint64Result](want)
got := *res.OK()
fmt.Printf("unsafe.Sizeof(res): %d\n", unsafe.Sizeof(res))
fmt.Printf("got: %v want: %v\n", got, want)
// fmt.Printf("unsafe.Sizeof(res): %d\n", unsafe.Sizeof(res))
// fmt.Printf("got: %v want: %v\n", got, want)
if got != want {
t.Errorf("*res.OK(): %v, expected %v", got, want)
}
Expand All @@ -221,8 +220,8 @@ func TestIssue95Struct(t *testing.T) {
want := stringStruct{s: "hello"}
res := OK[structResult](want)
got := *res.OK()
fmt.Printf("unsafe.Sizeof(res): %d\n", unsafe.Sizeof(res))
fmt.Printf("got: %v want: %v\n", got, want)
// fmt.Printf("unsafe.Sizeof(res): %d\n", unsafe.Sizeof(res))
// fmt.Printf("got: %v want: %v\n", got, want)
if got != want {
t.Errorf("*res.OK(): %v, expected %v", got, want)
}
Expand All @@ -233,8 +232,8 @@ func TestIssue95BoolInt64(t *testing.T) {
want := int64(1234567890)
res := Err[boolInt64Result](1234567890)
got := *res.Err()
fmt.Printf("unsafe.Sizeof(res): %d\n", unsafe.Sizeof(res))
fmt.Printf("got: %v want: %v\n", got, want)
// fmt.Printf("unsafe.Sizeof(res): %d\n", unsafe.Sizeof(res))
// fmt.Printf("got: %v want: %v\n", got, want)
if got != want {
t.Errorf("*res.OK(): %v, expected %v", got, want)
}
Expand Down

0 comments on commit 921df28

Please sign in to comment.