Slightly increase code coverage
All checks were successful
timw4mail/gilo/pipeline/head This commit looks good
All checks were successful
timw4mail/gilo/pipeline/head This commit looks good
This commit is contained in:
parent
fa584a6306
commit
4fdb0a607c
@ -17,3 +17,12 @@ func TestNewPoint(t *testing.T) {
|
||||
t.Errorf("Failure to create proper Point")
|
||||
}
|
||||
}
|
||||
|
||||
func TestPoint_Clone(t *testing.T) {
|
||||
point := DefaultPoint()
|
||||
point2 := point.Clone()
|
||||
|
||||
if point == point2 {
|
||||
t.Errorf("Point is identical, not cloned")
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,9 @@
|
||||
package key
|
||||
|
||||
import "unicode"
|
||||
import (
|
||||
"strings"
|
||||
"unicode"
|
||||
)
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// !Terminal Input Escape Code Sequences
|
||||
@ -39,5 +42,5 @@ func Ctrl(char rune) rune {
|
||||
|
||||
// IsSeparator Is the character a general token separator type?
|
||||
func IsSeparator(char rune) bool {
|
||||
return unicode.IsPunct(char) || unicode.IsSpace(char)
|
||||
return unicode.IsSpace(char) || strings.ContainsRune(",.()+-/*=~%<>[];", char)
|
||||
}
|
||||
|
@ -59,3 +59,12 @@ func TestCtrl(t *testing.T) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestIsSeparator(t *testing.T) {
|
||||
separators := ",.()+-/*=~%<>[] \t"
|
||||
for _, r := range separators {
|
||||
if !IsSeparator(r) {
|
||||
t.Errorf("Expected %q to be a syntax separator", r)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user