logging: adds clock scope (#1071)
Signed-off-by: Adrian Cole <adrian@tetrate.io>
This commit is contained in:
@@ -25,21 +25,10 @@ func Test_crypto(t *testing.T) {
|
||||
require.Equal(t, `7a0c9f9f0d
|
||||
`, stdout)
|
||||
|
||||
// TODO: Go 1.17 initializes randoms in a different order than Go 1.18,19
|
||||
// When we move to 1.20, remove the workaround.
|
||||
if log.String() != `==> go.runtime.getRandomData(r_len=32)
|
||||
<==
|
||||
==> go.runtime.getRandomData(r_len=8)
|
||||
<==
|
||||
==> go.syscall/js.valueCall(crypto.getRandomValues(r_len=5))
|
||||
<== (n=5)
|
||||
` {
|
||||
require.Equal(t, `==> go.runtime.getRandomData(r_len=8)
|
||||
<==
|
||||
==> go.runtime.getRandomData(r_len=32)
|
||||
<==
|
||||
==> go.syscall/js.valueCall(crypto.getRandomValues(r_len=5))
|
||||
<== (n=5)
|
||||
`, log.String())
|
||||
}
|
||||
// Search for the two functions that should be in scope, flexibly, to pass
|
||||
// go 1.17-19
|
||||
require.Contains(t, log.String(), `go.runtime.getRandomData(r_len=32)
|
||||
<==`)
|
||||
require.Contains(t, log.String(), `==> go.syscall/js.valueCall(crypto.getRandomValues(r_len=5))
|
||||
<== (n=5)`)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user