TestCopyOfCopy tests that modified objects are carried over to the copy, and the copy of the copy. See https://github.com/ethereum/go-ethereum/pull/15225#issuecomment-380191512
(t *testing.T)
| 423 | // TestCopyOfCopy tests that modified objects are carried over to the copy, and the copy of the copy. |
| 424 | // See https://github.com/ethereum/go-ethereum/pull/15225#issuecomment-380191512 |
| 425 | func TestCopyOfCopy(t *testing.T) { |
| 426 | sdb, _ := New(common.Hash{}, NewDatabase(database.NewMemDatabase())) |
| 427 | addr := common.HexToAddress("aaaa") |
| 428 | sdb.SetBalance(addr, big.NewInt(42)) |
| 429 | |
| 430 | if got := sdb.Copy().GetBalance(addr).Uint64(); got != 42 { |
| 431 | t.Fatalf("1st copy fail, expected 42, got %v", got) |
| 432 | } |
| 433 | if got := sdb.Copy().Copy().GetBalance(addr).Uint64(); got != 42 { |
| 434 | t.Fatalf("2nd copy fail, expected 42, got %v", got) |
| 435 | } |
| 436 | } |
nothing calls this directly
no test coverage detected