pull/12/head v0.0.2
isthisnagee 3 years ago
parent d00ceceeec
commit ba188c53ee

@ -26,7 +26,7 @@ var listCmd = &cobra.Command{
q := model.GetDiaryEntriesQuery{}
*num_entries = viper.GetInt64("listNumEntries")
if (*num_entries > 0) {
if *num_entries > 0 {
q.NumEntries = num_entries
}

@ -7,9 +7,9 @@ package cmd
import (
"time"
"github.com/spf13/viper"
"git.nagee.dev/isthisnagee/diary/model"
"github.com/spf13/cobra"
"github.com/spf13/viper"
)
// todayCmd represents the today command

@ -2,8 +2,8 @@ package model
import (
"git.nagee.dev/isthisnagee/diary/db"
"testing"
"runtime/debug"
"testing"
)
func assert_string(t *testing.T, expected string, actual string) {
@ -120,7 +120,6 @@ func TestGetDiaryEntries(t *testing.T) {
assert_int(t, result_2.Id, entries[0].Id)
assert_int(t, result_1.Id, entries[1].Id)
var numEntries = new(int64)
*numEntries = 1
entries = app.GetDiaryEntries(
@ -132,6 +131,5 @@ func TestGetDiaryEntries(t *testing.T) {
assert_int(t, int64(len(entries)), 1)
assert_int(t, result_2.Id, entries[0].Id)
teardown(app)
}

Loading…
Cancel
Save