Skip to content

Commit

Permalink
#234 Updated test cases as func changes in str.
Browse files Browse the repository at this point in the history
  • Loading branch information
ericzhang6222 committed May 13, 2020
1 parent 509fc6c commit 81aa4cf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion internal/shell/shell_cmd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ func TestIsCommand(t *testing.T) {
t.Parallel()

assert.True(t, isCommand("/hi"))
assert.False(t, isCommand("//str.join"))
assert.False(t, isCommand("//seq.join"))
}

func TestTryRunCommand(t *testing.T) {
Expand Down
10 changes: 5 additions & 5 deletions internal/shell/shell_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,10 @@ func TestGetLastToken(t *testing.T) {
assert.Equal(t, "//str", getLastToken([]rune("//str")))
assert.Equal(t, "//", getLastToken([]rune("//")))
assert.Equal(t, "///", getLastToken([]rune("///")))
assert.Equal(t, "//", getLastToken([]rune("//str.contains(//")))
assert.Equal(t, "//arch", getLastToken([]rune("//str.contains(//arch")))
assert.Equal(t, "tuple.", getLastToken([]rune("//str.contains(tuple.")))
assert.Equal(t, "", getLastToken([]rune("//str.contains(")))
assert.Equal(t, "//", getLastToken([]rune("//seq.contains(//")))
assert.Equal(t, "//arch", getLastToken([]rune("//seq.contains(//arch")))
assert.Equal(t, "tuple.", getLastToken([]rune("//seq.contains(tuple.")))
assert.Equal(t, "", getLastToken([]rune("//seq.contains(")))
assert.Equal(t, "", getLastToken([]rune("")))
}

Expand All @@ -147,7 +147,7 @@ func TestTabCompletionStdlib(t *testing.T) {
stdlibNames := stdlib.Names().OrderedNames()

assertTabCompletion(t, append(stdlibNames, "{"), 0, "//\t", nil)
assertTabCompletion(t, append(stdlibNames, "{"), 0, "//str.contains(//\t", nil)
assertTabCompletion(t, append(stdlibNames, "{"), 0, "//seq.contains(//\t", nil)
prefix := "s"

assertTabCompletionWithPrefix(t, prefix, stdlibNames, "//%s\t", nil)
Expand Down

0 comments on commit 81aa4cf

Please sign in to comment.