Skip to content

Commit

Permalink
fix: simplify test
Browse files Browse the repository at this point in the history
  • Loading branch information
joshmedeski committed Aug 23, 2024
1 parent 8197b61 commit 38a3d4b
Showing 1 changed file with 3 additions and 29 deletions.
32 changes: 3 additions & 29 deletions tmux/list_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,36 +19,10 @@ func TestListSessions(t *testing.T) {
)
sessions, err := tmux.ListSessions()
assert.Nil(t, err)
const timeFormat = "2006-01-02 15:04:05 -0700 MST"
created, _ := time.Parse(timeFormat, "2024-04-25 19:02:45 -0500 CDT")
lastAttached, _ := time.Parse(timeFormat, "2024-04-25 19:44:06 -0500 CDT")
activity, _ := time.Parse(timeFormat, "2024-04-25 19:44:06 -0500 CDT")
expectedSessions := []*model.TmuxSession{
{
Created: &created,
LastAttached: &lastAttached,
Activity: &activity,
Group: "",
Path: "/Users/joshmedeski/c/sesh/main",
Name: "sesh/main",
ID: "$1",
AttachedList: []string{""},
GroupList: []string{""},
GroupAttachedList: []string{""},
Stack: []int{2, 1},
Alerts: []int{},
GroupSize: 0,
GroupAttached: 0,
Attached: 0,
Windows: 2,
Format: true,
GroupManyAttached: false,
Grouped: false,
ManyAttached: false,
Marked: false,
},
for _, session := range sessions {
assert.Equal(t, "sesh/main", session.Name)
assert.Equal(t, "/Users/joshmedeski/c/sesh/main", session.Path)
}
assert.Equal(t, expectedSessions, sessions)
})

t.Run("parseTmuxSessionsOutput", func(t *testing.T) {
Expand Down

0 comments on commit 38a3d4b

Please sign in to comment.