mirror of
https://github.com/1f349/violet.git
synced 2024-11-13 23:11:36 +00:00
23 lines
360 B
Go
23 lines
360 B
Go
|
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)
|
||
|
}
|