MCPcopy
hub / github.com/tdewolff/minify / TestBinaryNumber

Function TestBinaryNumber

js/util_test.go:12–18  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

10)
11
12func TestBinaryNumber(t *testing.T) {
13 test.Bytes(t, binaryNumber([]byte("0b0"), 0), []byte("0"))
14 test.Bytes(t, binaryNumber([]byte("0b1"), 0), []byte("1"))
15 test.Bytes(t, binaryNumber([]byte("0b1001"), 0), []byte("9"))
16 test.Bytes(t, binaryNumber([]byte("0b100000000000000000000000000000000000000000000000000000000000000"), 0), []byte("4611686018427387904"))
17 test.Bytes(t, binaryNumber([]byte("0b1000000000000000000000000000000000000000000000000000000000000000"), 0), []byte("0b1000000000000000000000000000000000000000000000000000000000000000"))
18}
19
20func TestOctalNumber(t *testing.T) {
21 test.Bytes(t, octalNumber([]byte("0o0"), 0), []byte("0"))

Callers

nothing calls this directly

Calls 2

binaryNumberFunction · 0.85
BytesMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…