Skip to content

Commit

Permalink
test: remove rendered/ from test/
Browse files Browse the repository at this point in the history
  • Loading branch information
anirudhsudhir committed Apr 11, 2024
1 parent 7fac334 commit d5441af
Show file tree
Hide file tree
Showing 14 changed files with 13 additions and 143 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
!rendered/
site/rendered/
**/rendered/
anna
!anna/
*.exe
Expand Down
4 changes: 2 additions & 2 deletions pkg/engine/anna_engine_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ func TestRenderTags(t *testing.T) {
if err != nil {
t.Errorf("%v", err)
}
os.MkdirAll(TestDirPath+"render_tags/rendered", 0750)
e.RenderTags(fileOutPath, templ)

t.Run("render tag.html", func(t *testing.T) {
Expand Down Expand Up @@ -105,12 +106,11 @@ func TestRenderTags(t *testing.T) {
}

if !slices.Equal(got_tech_file, want_tech_file) {
t.Errorf("The expected and generated tech.html tag-subpage can be found in test/engine/render_tags/rendered/tags/")
t.Errorf("The expected and generated tech.html tag-subpage can be found in test/engine/render_tags/rendered/tags/")
}
})
}


func TestGenerateMergedJson(t *testing.T) {
t.Run("test json creation from e.Templates", func(t *testing.T) {
e := engine.Engine{
Expand Down
4 changes: 4 additions & 0 deletions pkg/engine/engine_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,13 @@ func TestRenderUserDefinedPages(t *testing.T) {
parser.TemplateData{
FilenameWithoutExtension: "index",
Body: template.HTML("<h1>Index Page</h1>"),
CompleteURL: "index.html",
}

engine.Templates["posts/hello.md"] = parser.TemplateData{
FilenameWithoutExtension: "hello",
Body: template.HTML("<h1>Hello World</h1>"),
CompleteURL: "posts/hello.html",
}

t.Run("render a set of user defined pages", func(t *testing.T) {
Expand All @@ -35,6 +37,8 @@ func TestRenderUserDefinedPages(t *testing.T) {
if err != nil {
t.Errorf("%v", err)
}

os.MkdirAll(TestDirPath+"render_user_defined/rendered", 0750)
engine.RenderUserDefinedPages(TestDirPath+"render_user_defined/", templ)

want_index_file, err := os.ReadFile(TestDirPath + "render_user_defined/want_index.html")
Expand Down
3 changes: 2 additions & 1 deletion pkg/engine/engine_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ func TestRenderPage(t *testing.T) {
t.Errorf("%v", err)
}

engine.RenderPage(TestDirPath+"engine/render_page/", "posts/got.md", page, templ, "page")
os.MkdirAll(TestDirPath+"render_page/rendered", 0750)
engine.RenderPage(TestDirPath+"render_page/", "posts/got.md", page, templ, "page")

got_file, err := os.ReadFile(TestDirPath + "render_page/rendered/posts/got.html")
if err != nil {
Expand Down
1 change: 1 addition & 0 deletions pkg/engine/user_engine_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ func TestRenderEngineGeneratedFiles(t *testing.T) {
t.Errorf("%v", err)
}

os.MkdirAll(TestDirPath+"render_engine_generated/rendered", 0750)
engine.RenderEngineGeneratedFiles(TestDirPath+"render_engine_generated/", templ)

want_posts_file, err := os.ReadFile(TestDirPath + "render_engine_generated/want_posts.html")
Expand Down
18 changes: 0 additions & 18 deletions test/engine/engine/render_page/rendered/posts/got.html

This file was deleted.

40 changes: 0 additions & 40 deletions test/engine/render_engine_generated/rendered/posts.html

This file was deleted.

18 changes: 0 additions & 18 deletions test/engine/render_page/rendered/posts/got.html

This file was deleted.

13 changes: 0 additions & 13 deletions test/engine/render_tags/rendered/tags.html

This file was deleted.

13 changes: 0 additions & 13 deletions test/engine/render_tags/rendered/tags/blogs.html

This file was deleted.

13 changes: 0 additions & 13 deletions test/engine/render_tags/rendered/tags/tech.html

This file was deleted.

10 changes: 0 additions & 10 deletions test/engine/render_user_defined/rendered/index.html

This file was deleted.

10 changes: 0 additions & 10 deletions test/engine/render_user_defined/rendered/posts/hello.html

This file was deleted.

6 changes: 3 additions & 3 deletions test/engine/sitemap/got_sitemap.xml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>example.org/index.html</loc>
<loc>example.org/about.html</loc>
<lastmod>2024-02-23</lastmod>
</url>
<url>
<loc>example.org/research.html</loc>
<loc>example.org/index.html</loc>
<lastmod>2024-02-23</lastmod>
</url>
<url>
<loc>example.org/about.html</loc>
<loc>example.org/research.html</loc>
<lastmod>2024-02-23</lastmod>
</url>
</urlset>

0 comments on commit d5441af

Please sign in to comment.