learn-go-with-tests/pointererror/pointererror_test.go
2025-02-01 21:18:14 -05:00

22 lines
315 B
Go

package pointererror
import (
"fmt"
"testing"
)
func TestWallet(t *testing.T) {
wallet := Wallet{}
wallet.Deposit(Bitcoin(10))
got := wallet.Balance()
fmt.Printf("address of balance in test is %p \n", &wallet.balance)
want := Bitcoin(10)
if got != want {
t.Errorf("got %s want %s", got, want)
}
}