github.com/bcampbell/scrapeomat@v0.0.0-20220820232205-23e64141c89e/arc/arc_test.go (about)

     1  package arc
     2  
     3  import (
     4  	"testing"
     5  )
     6  
     7  func TestSpreadPath(t *testing.T) {
     8  	testData := []struct{ in, out string }{
     9  		{"12345678", "1/12/123"},
    10  		{"2e90f06712788ea6fefe1e613d651e78.warc", "2/2e/2e9"},
    11  	}
    12  
    13  	for _, dat := range testData {
    14  		got := spreadPath(dat.in)
    15  
    16  		if got != dat.out {
    17  			t.Errorf(`genPath("%s") failed (got "%s", expected "%s")`, dat.in, got, dat.out)
    18  			return
    19  		}
    20  	}
    21  
    22  }