mirror of
https://github.com/ergochat/ergo.git
synced 2024-11-10 22:19:31 +01:00
add uncommitted test file
This commit is contained in:
parent
38b228af6a
commit
d5ebebaa5b
23
irc/utils/args_test.go
Normal file
23
irc/utils/args_test.go
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
// Copyright (c) 2019 Shivaram Lingamneni <slingamn@cs.stanford.edu>
|
||||||
|
// released under the MIT license
|
||||||
|
|
||||||
|
package utils
|
||||||
|
|
||||||
|
import "testing"
|
||||||
|
|
||||||
|
func TestStringToBool(t *testing.T) {
|
||||||
|
val, err := StringToBool("on")
|
||||||
|
assertEqual(val, true, t)
|
||||||
|
assertEqual(err, nil, t)
|
||||||
|
|
||||||
|
val, err = StringToBool("n")
|
||||||
|
assertEqual(val, false, t)
|
||||||
|
assertEqual(err, nil, t)
|
||||||
|
|
||||||
|
val, err = StringToBool("OFF")
|
||||||
|
assertEqual(val, false, t)
|
||||||
|
assertEqual(err, nil, t)
|
||||||
|
|
||||||
|
val, err = StringToBool("default")
|
||||||
|
assertEqual(err, ErrInvalidParams, t)
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user