예제 #1
0
func TestFileSystemProviderNotExistPackage(t *testing.T) {
	t.Parallel()
	p := commonjs.NewFileSystemProvider(pkgrsrc.New("foo"))
	if _, err := p.Module("xyz"); err == nil {
		t.Fatal("did not find expected error")
	}
}
예제 #2
0
func TestFileSystemProviderNotExistModule(t *testing.T) {
	t.Parallel()
	p := commonjs.NewFileSystemProvider(
		pkgrsrc.New("github.com/daaku/go.commonjs/_test"))
	if _, err := p.Module("xyz"); err == nil {
		t.Fatal("did not find expected error")
	}
}
예제 #3
0
func TestFileSystemProvider(t *testing.T) {
	t.Parallel()
	const name = "b/baz"
	p := commonjs.NewFileSystemProvider(
		pkgrsrc.New("github.com/daaku/go.commonjs/_test"))
	m, err := p.Module(name)
	if err != nil {
		t.Fatal(err)
	}
	if m.Name() != name {
		t.Fatal("did not find expected name")
	}
}