Skip to content

Commit

Permalink
Fixing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
drewstinnett committed Feb 3, 2024
1 parent d16df98 commit d90041a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 3 additions & 1 deletion cmd/letseat/cmd/import.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ func runImport(cmd *cobra.Command, args []string) error {
entries: entries,
current: &zero,
}
_, rerr := tea.NewProgram(pb).Run()
// fn, _ := os.Open("/tmp/whatever.txt")
_, rerr := tea.NewProgram(pb, tea.WithInput(os.Stdin)).Run()
if rerr != nil {
slog.Error("error running progressbar", "error", rerr)
}
Expand Down Expand Up @@ -76,6 +77,7 @@ func (p pbar) View() string {
func (p pbar) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
switch msg := msg.(type) {
case tea.KeyMsg:
panic("foo")
return p, tea.Quit

case tea.WindowSizeMsg:
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ require (
github.com/spf13/viper v1.16.0
github.com/stretchr/testify v1.8.4
go.etcd.io/bbolt v1.3.8
golang.org/x/term v0.13.0
gopkg.in/yaml.v2 v2.4.0
)

Expand Down Expand Up @@ -64,7 +65,6 @@ require (
golang.org/x/net v0.17.0 // indirect
golang.org/x/sync v0.4.0 // indirect
golang.org/x/sys v0.13.0 // indirect
golang.org/x/term v0.13.0 // indirect
golang.org/x/text v0.13.0 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
Expand Down
4 changes: 3 additions & 1 deletion pkg/person_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ func TestPeople(t *testing.T) {

for _, tt := range ts {
got := tt.diary.people()
require.Equal(t, tt.want, got)
for _, witem := range tt.want {
require.Contains(t, got, witem)
}
}
}

Expand Down

0 comments on commit d90041a

Please sign in to comment.