mirror of
https://github.com/1f349/violet.git
synced 2024-11-22 03:11:44 +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)
|
||
|
}
|