aboutsummaryrefslogtreecommitdiff
path: root/watcher_test.go
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2022-08-06 13:41:11 +0700
committerShulhan <ms@kilabit.info>2022-08-06 13:41:11 +0700
commit4624f716d8e2a8ed78326025323417cc9c5d6dd0 (patch)
tree8ee61c1f16a59b480abc7440f067984799a5a6e1 /watcher_test.go
parent427da25f96d0a54294a27d376d4833622fba50f0 (diff)
downloadciigo-4624f716d8e2a8ed78326025323417cc9c5d6dd0.tar.xz
all: cleaning up codes
Diffstat (limited to 'watcher_test.go')
-rw-r--r--watcher_test.go26
1 files changed, 13 insertions, 13 deletions
diff --git a/watcher_test.go b/watcher_test.go
index 0e082f2..6b219d1 100644
--- a/watcher_test.go
+++ b/watcher_test.go
@@ -21,7 +21,7 @@ var (
func TestWatcher(t *testing.T) {
var (
- testDir = "testdata/watcher"
+ testDir = `testdata/watcher`
convertOpts = ConvertOptions{
Root: testDir,
}
@@ -44,7 +44,7 @@ func TestWatcher(t *testing.T) {
os.RemoveAll(testDir)
})
- converter, err = NewConverter("testdata/html.tmpl")
+ converter, err = NewConverter(`testdata/html.tmpl`)
if err != nil {
t.Fatal(err)
}
@@ -64,9 +64,9 @@ func TestWatcher(t *testing.T) {
t.Fatal(err)
}
- t.Run("createAdocFile", testCreate)
- t.Run("updateAdocFile", testUpdate)
- t.Run("deleteAdocFile", testDelete)
+ t.Run(`createAdocFile`, testCreate)
+ t.Run(`updateAdocFile`, testUpdate)
+ t.Run(`deleteAdocFile`, testDelete)
}
func testCreate(t *testing.T) {
@@ -77,7 +77,7 @@ func testCreate(t *testing.T) {
gotBody []byte
)
- testFileAdoc = filepath.Join(testWatcher.dir, "index.adoc")
+ testFileAdoc = filepath.Join(testWatcher.dir, `index.adoc`)
testAdocFile, err = os.Create(testFileAdoc)
if err != nil {
t.Fatal(err)
@@ -85,7 +85,7 @@ func testCreate(t *testing.T) {
got = waitChanges()
- test.Assert(t, "New adoc file created", testFileAdoc, got.path)
+ test.Assert(t, `New adoc file created`, testFileAdoc, got.path)
expBody = `<!DOCTYPE>
<html>
@@ -108,7 +108,7 @@ func testCreate(t *testing.T) {
}
gotBody = removeFooter(gotBody)
- test.Assert(t, "HTML body", expBody, string(gotBody))
+ test.Assert(t, `HTML body`, expBody, string(gotBody))
}
func testUpdate(t *testing.T) {
@@ -119,7 +119,7 @@ func testUpdate(t *testing.T) {
got *fileMarkup
)
- _, err = testAdocFile.WriteString("= Hello")
+ _, err = testAdocFile.WriteString(`= Hello`)
if err != nil {
t.Fatal(err)
}
@@ -129,7 +129,7 @@ func testUpdate(t *testing.T) {
}
got = waitChanges()
- test.Assert(t, "adoc file updated", testFileAdoc, got.path)
+ test.Assert(t, `adoc file updated`, testFileAdoc, got.path)
expBody = `<!DOCTYPE>
<html>
@@ -154,7 +154,7 @@ func testUpdate(t *testing.T) {
gotBody = removeFooter(gotBody)
- test.Assert(t, "HTML body", expBody, string(gotBody))
+ test.Assert(t, `HTML body`, expBody, string(gotBody))
}
func testDelete(t *testing.T) {
@@ -175,10 +175,10 @@ func testDelete(t *testing.T) {
}
got = waitChanges()
- test.Assert(t, "adoc file updated", testFileAdoc, got.path)
+ test.Assert(t, `adoc file updated`, testFileAdoc, got.path)
_, gotIsExist = testWatcher.fileMarkups[testFileAdoc]
- test.Assert(t, "adoc file deleted", false, gotIsExist)
+ test.Assert(t, `adoc file deleted`, false, gotIsExist)
}
// removeFooter remove the footer from generated HTML since its contains date