Пример #1
0
func TestReaderShouldReadError(t *testing.T) {
	assert := assert.New(t)
	reader := strings.NewReader("ff")
	_, err := Read(reader)
	assert.ThatBool(err == nil).IsFalse()
}
Пример #2
0
func TestHelpShouldSearchWholeParamsList(t *testing.T) {
	assert := assert.New(t)
	result := ShouldDisplayHelp([]string{"", "", "", "-help"})
	assert.ThatBool(result).IsTrue()
}
Пример #3
0
func TestHelpShouldReturnFalseIsNotAskedForHelp(t *testing.T) {
	assert := assert.New(t)
	result := ShouldDisplayHelp([]string{})
	assert.ThatBool(result).IsFalse()
}
Пример #4
0
func TestHelpShouldReturnTrue6(t *testing.T) {
	assert := assert.New(t)
	result := ShouldDisplayHelp([]string{"/?"})
	assert.ThatBool(result).IsTrue()
}