forked from microsoft/go-sqlcmd
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathroot_test.go
More file actions
27 lines (23 loc) · 690 Bytes
/
root_test.go
File metadata and controls
27 lines (23 loc) · 690 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
package main
import (
"github.com/microsoft/go-sqlcmd/internal/cmdparser"
"github.com/microsoft/go-sqlcmd/internal/cmdparser/dependency"
"github.com/stretchr/testify/assert"
"testing"
)
// TestRoot is a quick sanity test
func TestRoot(t *testing.T) {
c := cmdparser.New[*Root](dependency.Options{})
c.DefineCommand()
c.SetArgsForUnitTesting([]string{})
c.Execute()
}
func TestIsValidSubCommand(t *testing.T) {
c := cmdparser.New[*Root](dependency.Options{})
invalid := c.IsValidSubCommand("nope")
assert.Equal(t, false, invalid)
valid := c.IsValidSubCommand("query")
assert.Equal(t, true, valid)
}