| 1 | package main |
| 2 | |
| 3 | import ( |
| 4 | "testing" |
| 5 | "testing/synctest" |
| 6 | ) |
| 7 | |
| 8 | func TestPromptHistoryTapeIdentityDoesNotDependOnClockTicks(t *testing.T) { |
| 9 | dirA, dirB := t.TempDir(), t.TempDir() |
| 10 | synctest.Test(t, func(t *testing.T) { |
| 11 | first, err := newPromptHistoryTape(dirA, "") |
| 12 | if err != nil { |
| 13 | t.Fatal(err) |
| 14 | } |
| 15 | second, err := newPromptHistoryTape(dirB, "") |
| 16 | if err != nil { |
| 17 | t.Fatal(err) |
| 18 | } |
| 19 | if first.nonce == second.nonce { |
| 20 | t.Fatal("different prompt-history tapes shared an identity within one clock tick") |
| 21 | } |
| 22 | }) |
| 23 | } |
| 24 |