test default or custom salt on NewMnemonic func

This commit is contained in:
Andrea Franz 2018-03-14 11:05:37 +01:00
parent a1da71e968
commit eb112b89f9
No known key found for this signature in database
GPG Key ID: 4F0D2F2D9DE7F29D
1 changed files with 13 additions and 0 deletions

View File

@ -16,6 +16,19 @@ type Vector struct {
language, salt, password, input, mnemonic, seed, xprv string language, salt, password, input, mnemonic, seed, xprv string
} }
func TestNewMnemonic(t *testing.T) {
m1 := NewMnemonic("")
if m1.salt != Salt {
t.Errorf("expected default salt, got: %q", m1.salt)
}
customSalt := "custom-salt"
m2 := NewMnemonic(customSalt)
if m2.salt != customSalt {
t.Errorf("expected %q, got: %q", customSalt, m2.salt)
}
}
// TestMnemonicPhrase // TestMnemonicPhrase
func TestMnemonicPhrase(t *testing.T) { func TestMnemonicPhrase(t *testing.T) {