mirror of
https://github.com/luxfi/cli.git
synced 2026-10-30 17:01:20 +00:00
Update CLI for genesis Fix import paths from ethereum/go-ethereum to luxfi/geth - Replace all ethereum/go-ethereum imports with luxfi/geth - Add local rawdb package for unexported constants - Fix build errors in genesis tools - Add comprehensive migration documentation - Create build-all.sh script for building all tools - Clean up duplicate functions and unused imports Fix remaining imports Update CLI Remove symlink Remove local replace directives Update Update old templates
81 lines
1.3 KiB
Go
81 lines
1.3 KiB
Go
// Copyright (C) 2025, Lux Industries Inc. All rights reserved.
|
|
// See the file LICENSE for licensing terms.
|
|
package flags
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func TestMutuallyExclusive(t *testing.T) {
|
|
require := require.New(t)
|
|
type test struct {
|
|
flagA bool
|
|
flagB bool
|
|
flagC bool
|
|
expectError bool
|
|
}
|
|
|
|
tests := []test{
|
|
{
|
|
flagA: false,
|
|
flagB: false,
|
|
flagC: false,
|
|
expectError: false,
|
|
},
|
|
{
|
|
flagA: true,
|
|
flagB: false,
|
|
flagC: false,
|
|
expectError: false,
|
|
},
|
|
{
|
|
flagA: false,
|
|
flagB: true,
|
|
flagC: false,
|
|
expectError: false,
|
|
},
|
|
{
|
|
flagA: false,
|
|
flagB: false,
|
|
flagC: true,
|
|
expectError: false,
|
|
},
|
|
{
|
|
flagA: true,
|
|
flagB: false,
|
|
flagC: true,
|
|
expectError: true,
|
|
},
|
|
{
|
|
flagA: false,
|
|
flagB: true,
|
|
flagC: true,
|
|
expectError: true,
|
|
},
|
|
{
|
|
flagA: true,
|
|
flagB: true,
|
|
flagC: false,
|
|
expectError: true,
|
|
},
|
|
{
|
|
flagA: true,
|
|
flagB: true,
|
|
flagC: true,
|
|
expectError: true,
|
|
},
|
|
}
|
|
|
|
for _, tt := range tests {
|
|
flags := []bool{tt.flagA, tt.flagB, tt.flagC}
|
|
isEx := EnsureMutuallyExclusive(flags)
|
|
if tt.expectError {
|
|
require.False(isEx)
|
|
} else {
|
|
require.True(isEx)
|
|
}
|
|
}
|
|
}
|