Skip to content

Commit

Permalink
Remove typos
Browse files Browse the repository at this point in the history
  • Loading branch information
sbstjn committed Oct 16, 2016
1 parent fa608c3 commit 766b863
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion command.go
Expand Up @@ -78,7 +78,7 @@ func (c Command) HasParameter(param ParameterInterface) bool {
return false
}

// Position returns the position of a paramter
// Position returns the position of a parameter
func (c Command) Position(param ParameterInterface) int {
for index, item := range c.Parameters() {
if item.Equals(param) {
Expand Down
14 changes: 7 additions & 7 deletions command_test.go
Expand Up @@ -82,11 +82,11 @@ func TestMatches(t *testing.T) {
{"command", "command", true},
{"command", "command example", false},
{"command <lorem>", "command", false},
{"command <lorem>", "command exmaple", true},
{"command <lorem>", "command example", true},
{"command <lorem>", "command 1234567", true},
{"command <lorem>", "command command", true},
{"command <lorem>", "example command", false},
{"command <lorem:integer>", "command exmaple", false},
{"command <lorem:integer>", "command example", false},
{"command <lorem:integer>", "command 1234567", true},
{"command <lorem>", "command command command", false},
}
Expand All @@ -102,9 +102,9 @@ func TestMatches(t *testing.T) {

func TestPosition(t *testing.T) {
var data = []struct {
command string
param Parameter
postion int
command string
param Parameter
position int
}{
{"command <lorem>", NewParameter("lorem", Expression("string")), 0},
{"command <lorem> <ipsum> <dolor> <sit> <amet>", NewParameter("dolor", Expression("string")), 2},
Expand All @@ -119,8 +119,8 @@ func TestPosition(t *testing.T) {
for _, set := range data {
cmd = NewCommand(set.command)

if cmd.Position(set.param) != set.postion {
t.Errorf("Position() should be \"%d\", but is \"%d\"", set.postion, cmd.Position(set.param))
if cmd.Position(set.param) != set.position {
t.Errorf("Position() should be \"%d\", but is \"%d\"", set.position, cmd.Position(set.param))
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion parameter_test.go
Expand Up @@ -16,7 +16,7 @@ func TestNewWithType(t *testing.T) {

for _, set := range data {
if !set.p1.Equals(set.p2) {
t.Errorf("Equals() returned false, this should not happend!")
t.Errorf("Equals() returned false, this should not happen!")
}
}
}
Expand Down

0 comments on commit 766b863

Please sign in to comment.