Something went wrong. Try again.
Fork of micro-editor/micro
Something went wrong. Try again.
1234567891011121314151617181920212223242526272829303132333435363738package config
import ( "testing"
"github.com/stretchr/testify/assert")
func init() { InitRuntimeFiles(false)}
func TestAddFile(t *testing.T) { AddRuntimeFile(RTPlugin, memoryFile{"foo.lua", []byte("hello world\n")})
f := FindRuntimeFile(RTPlugin, "foo.lua") assert.NotNil(t, f) assert.Equal(t, "foo.lua", f.Name()) data, err := f.Data() assert.Nil(t, err) assert.Equal(t, []byte("hello world\n"), data)}
func TestFindFile(t *testing.T) { f := FindRuntimeFile(RTHelp, "help") assert.NotNil(t, f) assert.Equal(t, "help", f.Name())}
func TestRemovedSyntaxSlots(t *testing.T) { if FindRuntimeFile(1, "go") != nil { t.Fatal("syntax runtime slot should be empty") } if FindRuntimeFile(4, "go") != nil { t.Fatal("syntax header runtime slot should be empty") }}