mirror of
https://github.com/luxfi/cli.git
synced 2026-10-30 17:01:20 +00:00
- Update github.com/luxfi/netrunner v1.15.3 → v1.15.4 - Update github.com/luxfi/node v1.22.77 → v1.22.80 - Remove local replace directive for netrunner - Use published package versions for reproducible builds
39 lines
917 B
Go
39 lines
917 B
Go
// Copyright (C) 2022-2025, Lux Industries Inc. All rights reserved.
|
|
// See the file LICENSE for licensing terms.
|
|
|
|
package prompts
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/luxfi/crypto"
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func TestContains(t *testing.T) {
|
|
require := require.New(t)
|
|
strList := []string{"test", "capture", "list"}
|
|
|
|
k1, _ := crypto.GenerateKey()
|
|
k2, _ := crypto.GenerateKey()
|
|
k3, _ := crypto.GenerateKey()
|
|
|
|
addr1 := crypto.PubkeyToAddress(k1.PublicKey)
|
|
addr2 := crypto.PubkeyToAddress(k2.PublicKey)
|
|
addr3 := crypto.PubkeyToAddress(k3.PublicKey)
|
|
|
|
addrList := []crypto.Address{
|
|
addr1,
|
|
addr2,
|
|
}
|
|
|
|
require.True(contains(strList, "test"))
|
|
require.True(contains(strList, "capture"))
|
|
require.True(contains(strList, "list"))
|
|
require.False(contains(strList, "false"))
|
|
|
|
require.True(contains(addrList, addr1))
|
|
require.True(contains(addrList, addr2))
|
|
require.False(contains(addrList, addr3))
|
|
}
|