...

Source file src/github.com/xrash/smetrics/tests/jaro_test.go

Documentation: github.com/xrash/smetrics/tests

     1  package tests
     2  
     3  import (
     4  	"fmt"
     5  	"github.com/xrash/smetrics"
     6  	"testing"
     7  )
     8  
     9  func TestJaro(t *testing.T) {
    10  	for _, c := range __jaro_cases {
    11  		r := smetrics.Jaro(c.a, c.b)
    12  		result := fmt.Sprintf("%.3f", r)
    13  		expected := fmt.Sprintf("%.3f", c.r)
    14  		if result != expected {
    15  			fmt.Println(c.a, c.b, result, "instead of", expected)
    16  			t.Fail()
    17  		}
    18  	}
    19  }
    20  

View as plain text