Skip to content

Commit

Permalink
fixed some broken tests
Browse files Browse the repository at this point in the history
  • Loading branch information
osteensco committed Oct 3, 2024
1 parent eea3388 commit 24070d7
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion ft/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ func changeDirectory(data *CmdArgs) error {
key = provided_string
p, ok := data.allPaths[key]
if !ok {
fmt.Printf("Did not recognize key '%s', use 'ft -ls' to see all saved destinations. If this is a relative path use './%s' or '%s/'.\n", key, key, key)
fmt.Printf("Did not recognize key '%s', use 'ft -ls' to see all saved destinations. If this is a relative path use './%s' or '%s/'. \n", key, key, key)
return nil
}

Expand Down
4 changes: 2 additions & 2 deletions ft/commands_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ func TestChangeDirectory(t *testing.T) {
{
name: "3. Invalid key provided.",
command: []string{"_", "testKye"},
expected: "Did not recognize key 'testKye', use 'ft -ls' to see all saved destinations. ",
expected: "Did not recognize key 'testKye', use 'ft -ls' to see all saved destinations. If this is a relative path use './testKye' or 'testKye/'. ",
allPaths: map[string]string{
"testKey": tmpdir,
},
Expand All @@ -112,7 +112,7 @@ func TestChangeDirectory(t *testing.T) {
{
name: "4. Invalid key provided, evaluate path.",
command: []string{"_", "testKye/subdir"},
expected: "Provided path testKye/subdir evaluates to testKye/subdir which is not a valid directory. Use 'ft -ls' to see all saved destinations. ",
expected: "Provided path 'testKye/subdir' evaluates to 'testKye/subdir' which is not a valid directory. Use 'ft -ls' to see all saved destinations. ",
allPaths: map[string]string{
"testKey": tmpdir,
},
Expand Down
1 change: 1 addition & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"github.com/osteensco/fastTravelCLI/ft"
)

// fastTravel main process
func main() {

// read in bin file
Expand Down
2 changes: 1 addition & 1 deletion main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func TestMainFunc(t *testing.T) {
{
name: "4. Check cd command with bad key.",
args: []string{"ft", "badkey"},
expected: "Did not recognize key 'badkey', use 'ft -ls' to see all saved destinations. \n",
expected: "Did not recognize key 'badkey', use 'ft -ls' to see all saved destinations. If this is a relative path use './badkey' or 'badkey/'. \n",
wantErr: false,
},
{
Expand Down

0 comments on commit 24070d7

Please sign in to comment.