|
@@ -37,6 +37,8 @@ func (t *quizTestSuite) TestReadAll() {
|
|
|
len(result),
|
|
|
),
|
|
|
)
|
|
|
+
|
|
|
+ _, err = removeQuizHeader(filepath.Join(store.Dir, "quiz_5.md"))
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -44,10 +46,11 @@ func (t *quizTestSuite) TestCreate() {
|
|
|
filePathConfig := FilePathConfig{"testdata/quizzes", "quiz", ".md"}
|
|
|
store, err := NewQuizFileStore(
|
|
|
&FileStoreConfig[*models.Quiz, *store.QuizStore]{
|
|
|
- FilePathConfig: filePathConfig,
|
|
|
- IndexDirFunc: DefaultIndexDirFunc[*models.Quiz, *store.QuizStore],
|
|
|
- UnmarshalFunc: DefaultUnmarshalQuizFunc,
|
|
|
- MarshalFunc: DefaultMarshalQuizFunc,
|
|
|
+ FilePathConfig: filePathConfig,
|
|
|
+ IndexDirFunc: DefaultIndexDirFunc[*models.Quiz, *store.QuizStore],
|
|
|
+ UnmarshalFunc: DefaultUnmarshalQuizFunc,
|
|
|
+ MarshalFunc: DefaultMarshalQuizFunc,
|
|
|
+ NoIndexOnCreate: true,
|
|
|
},
|
|
|
)
|
|
|
t.Nil(err)
|
|
@@ -106,10 +109,11 @@ func (t *quizTestSuite) TestDelete() {
|
|
|
filePathConfig := FilePathConfig{"testdata/quizzes", "quiz", ".md"}
|
|
|
store, err := NewQuizFileStore(
|
|
|
&FileStoreConfig[*models.Quiz, *store.QuizStore]{
|
|
|
- FilePathConfig: filePathConfig,
|
|
|
- IndexDirFunc: DefaultIndexDirFunc[*models.Quiz, *store.QuizStore],
|
|
|
- UnmarshalFunc: DefaultUnmarshalQuizFunc,
|
|
|
- MarshalFunc: DefaultMarshalQuizFunc,
|
|
|
+ FilePathConfig: filePathConfig,
|
|
|
+ IndexDirFunc: DefaultIndexDirFunc[*models.Quiz, *store.QuizStore],
|
|
|
+ UnmarshalFunc: DefaultUnmarshalQuizFunc,
|
|
|
+ MarshalFunc: DefaultMarshalQuizFunc,
|
|
|
+ NoIndexOnCreate: true,
|
|
|
},
|
|
|
)
|
|
|
t.Nil(err)
|
|
@@ -145,10 +149,11 @@ func (t *quizTestSuite) TestUpdate() {
|
|
|
filePathConfig := FilePathConfig{"testdata/quizzes", "quiz", ".md"}
|
|
|
store, err := NewQuizFileStore(
|
|
|
&FileStoreConfig[*models.Quiz, *store.QuizStore]{
|
|
|
- FilePathConfig: filePathConfig,
|
|
|
- IndexDirFunc: DefaultIndexDirFunc[*models.Quiz, *store.QuizStore],
|
|
|
- UnmarshalFunc: DefaultUnmarshalQuizFunc,
|
|
|
- MarshalFunc: DefaultMarshalQuizFunc,
|
|
|
+ FilePathConfig: filePathConfig,
|
|
|
+ IndexDirFunc: DefaultIndexDirFunc[*models.Quiz, *store.QuizStore],
|
|
|
+ UnmarshalFunc: DefaultUnmarshalQuizFunc,
|
|
|
+ MarshalFunc: DefaultMarshalQuizFunc,
|
|
|
+ NoIndexOnCreate: true,
|
|
|
},
|
|
|
)
|
|
|
t.Nil(err)
|