File tree Expand file tree Collapse file tree 2 files changed +25
-1
lines changed Expand file tree Collapse file tree 2 files changed +25
-1
lines changed Original file line number Diff line number Diff line change @@ -70,7 +70,7 @@ func (f *File) BuildCatalog() (*Catalog, error) {
7070 // process namespaces
7171 for name , ns := range f .Namespaces {
7272 // split name
73- segments := strings .Split (name , "." )
73+ segments := strings .SplitN (name , "." , 2 )
7474 if len (segments ) != 2 {
7575 return nil , fmt .Errorf ("invalid namespace name %q" , name )
7676 }
Original file line number Diff line number Diff line change 1+ package lungo
2+
3+ import (
4+ "testing"
5+
6+ "github.com/stretchr/testify/assert"
7+
8+ "github.com/256dpi/lungo/mongokit"
9+ )
10+
11+ func TestFile (t * testing.T ) {
12+ catalog := NewCatalog ()
13+ assert .NotNil (t , catalog )
14+
15+ catalog .Namespaces [Oplog ] = mongokit .NewCollection (false )
16+ catalog .Namespaces [Handle {"test" , "foo.bar" }] = mongokit .NewCollection (false )
17+
18+ file := BuildFile (catalog )
19+ assert .NotNil (t , file )
20+
21+ catalog2 , err := file .BuildCatalog ()
22+ assert .Nil (t , err )
23+ assert .NotNil (t , catalog2 )
24+ }
You can’t perform that action at this time.
0 commit comments