violet/utils/multi-compilable_test.go

23 lines
360 B
Go
Raw Normal View History

2023-06-04 22:28:48 +01:00
package utils
import (
"github.com/stretchr/testify/assert"
"testing"
)
type fakeCompile struct{ done bool }
func (f *fakeCompile) Compile() {
f.done = true
}
var _ Compilable = &fakeCompile{}
func TestMultiCompilable_Compile(t *testing.T) {
f := &fakeCompile{}
a := MultiCompilable{f}
assert.False(t, f.done)
a.Compile()
assert.True(t, f.done)
}