MCPcopy Create free account
hub / github.com/evilsocket/sum / BenchmarkCompiledIs

Function BenchmarkCompiledIs

service/compiled_benchmark_test.go:72–85  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

70}
71
72func BenchmarkCompiledIs(b *testing.B) {
73 oracle := pb.Oracle{Name: "simple", Code: "function simple(){ return 0; }"}
74 compiled, err := compile(&oracle)
75 if err != nil {
76 b.Fatal(err)
77 }
78
79 b.ResetTimer()
80 for i := 0; i < b.N; i++ {
81 if !compiled.Is(oracle) {
82 b.Fatal("compiled object does not match source oracle")
83 }
84 }
85}
86
87func benchVM(b *testing.B, fname, code string, args []string, expected string, records *storage.Records) {
88 oracle := pb.Oracle{

Callers

nothing calls this directly

Calls 2

compileFunction · 0.85
IsMethod · 0.45

Tested by

no test coverage detected