nmslib: v0.1.0
This commit is contained in:
78
nmslib_test.go
Normal file
78
nmslib_test.go
Normal file
@@ -0,0 +1,78 @@
|
||||
package nmslib
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestPortal2Galactic(t *testing.T) {
|
||||
want, err := P2gc("006afa556c30")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
if want != "042F:0079:0D55:006A" {
|
||||
t.Errorf("Testing P2gc(\"006afa556c30\"): got %q, want: %q.\n", want, "042F:0079:0D55:006A")
|
||||
} else {
|
||||
fmt.Printf("Testing P2gc(\"006afa556c30\"): got: %q, want: %q.\n", want, "042F:0079:0D55:006A")
|
||||
}
|
||||
}
|
||||
|
||||
func TestGalactic2portal(t *testing.T) {
|
||||
want, err := Gc2p("042F:0079:0D55:006A")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
if want != "106AFA556C30" {
|
||||
t.Errorf("Testing Gc2p(\"042F:0079:0D55:006A\"): got %q, want: %q.\n", want, "106AFA556C30")
|
||||
} else {
|
||||
fmt.Printf("Testing Gc2p(\"042F:0079:0D55:006A\"): got: %q, want: %q.\n", want, "106AFA556C30")
|
||||
}
|
||||
|
||||
want, err = Gc2p("044B:0081:0D68:0096")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
if want != "109602569C4C" {
|
||||
t.Errorf("Testing Gc2p(\"044B:0081:0D68:0096\"): got %q, want: %q.\n", want, "109602569C4C")
|
||||
} else {
|
||||
fmt.Printf("Testing Gc2p(\"044B:0081:0D68:0096\"): got: %q, want: %q.\n", want, "109602569C4C")
|
||||
}
|
||||
}
|
||||
|
||||
func TestCreateBanner(t *testing.T) {
|
||||
fmt.Printf("Testing CreateBanner: ")
|
||||
CreateBanner("006afa556c30", "/tmp/Test.png", 0)
|
||||
}
|
||||
|
||||
func TestKorvax2Eng(t *testing.T) {
|
||||
want := Korvax2Eng("eapoluch")
|
||||
if want != "emergency" {
|
||||
t.Errorf("Testing Korvax2eng(\"eapoluch\"): got %q, want: %q.\n", want, "emergency")
|
||||
} else {
|
||||
fmt.Printf("Testing Korvax2eng(\"eapoluch\"): got %q, want: %q.\n", want, "emergency")
|
||||
}
|
||||
|
||||
want = Korvax2Eng("notaword")
|
||||
if want != "*\\Kzzzzzzt\\*" {
|
||||
t.Errorf("Testing Korvax2eng(\"notaword\"): got %q, want: %q.\n", want, "*\\Kzzzzzzt\\*")
|
||||
} else {
|
||||
fmt.Printf("Testing Korvax2eng(\"notaword\"): got %q, want: %q.\n", want, "*\\Kzzzzzzt\\*")
|
||||
}
|
||||
}
|
||||
|
||||
func TestEng2Korvax(t *testing.T) {
|
||||
want := Eng2Korvax("emergency")
|
||||
if want != "eapoluch" {
|
||||
t.Errorf("Testing Eng2Korvax(\"emergency\"): got %q, want: %q.\n", want, "eapoluch")
|
||||
} else {
|
||||
fmt.Printf("Testing Eng2Korvax(\"emergency\"): got %q, want: %q.\n", want, "eapoluch")
|
||||
}
|
||||
|
||||
want = Eng2Korvax("notaword")
|
||||
if want != "*\\Kzzzzzzt\\*" {
|
||||
t.Errorf("Testing Eng2Korvax(\"notaword\"): got %q, want: %q.\n", want, "*\\Kzzzzzzt\\*")
|
||||
} else {
|
||||
fmt.Printf("Testing Eng2Korvax(\"notaword\"): got %q, want: %q.\n", want, "*\\Kzzzzzzt\\*")
|
||||
}
|
||||
fmt.Printf("Testing: ")
|
||||
}
|
||||
Reference in New Issue
Block a user