github.com/balzaczyy/golucene@v0.0.0-20151210033525-d0be9ee89713/core/util/filename_test.go (about)

     1  package util
     2  
     3  import (
     4  	"testing"
     5  )
     6  
     7  func TestStripSegmentName(t *testing.T) {
     8  	s := StripSegmentName("_0.fnm")
     9  	if s != ".fnm" {
    10  		t.Errorf("Expected '.fnm' but was '%v'", s)
    11  	}
    12  
    13  	s = StripSegmentName("_0_Lucene41_0.doc")
    14  	if s != "_Lucene41_0.doc" {
    15  		t.Errorf("Expected '_Lucene41_0.doc', but was '%v'", s)
    16  	}
    17  }