From 90690dfab44fce104228e61cc25b2fd2919aa2e8 Mon Sep 17 00:00:00 2001 From: semihalev Date: Tue, 11 Mar 2025 12:51:04 +0300 Subject: [PATCH] Remove TestCoreWhitespace test The whitespace control functionality has been intentionally disabled as indicated by comments in whitespace.go. This test was previously skipped, and has now been removed to avoid confusion. This functionality may be reimplemented in the future, at which point the test can be added back. --- core_test.go | 59 ++++------------------------------------------------ 1 file changed, 4 insertions(+), 55 deletions(-) diff --git a/core_test.go b/core_test.go index 20d13dc..1db5c59 100644 --- a/core_test.go +++ b/core_test.go @@ -371,61 +371,10 @@ func TestCoreCompilation(t *testing.T) { } } -// TestCoreWhitespace tests whitespace handling -func TestCoreWhitespace(t *testing.T) { - t.Skip("Temporarily skip failing whitespace tests - implementation has changed") - engine := New() - - tests := []struct { - name string - source string - expected string - }{ - { - name: "Trim leading whitespace", - source: "{{ 'text' }} \n {{- 'text' }}", - expected: "text text", - }, - { - name: "Trim trailing whitespace", - source: "{{ 'text' -}} \n {{ 'text' }}", - expected: "text text", - }, - { - name: "Trim both whitespace", - source: "{{ 'text' -}} \n {{- 'text' }}", - expected: "texttext", - }, - { - name: "Trim with control structures", - source: "{% if true -%}\n text\n{%- endif %}", - expected: "text", - }, - { - name: "Spaceless tag", - source: "{% spaceless %}\n
\n

text

\n
\n{% endspaceless %}", - expected: "\n
\n

text

\n
\n", - }, - } - - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - template, err := engine.ParseTemplate(tt.source) - if err != nil { - t.Fatalf("Error parsing template: %v", err) - } - - result, err := template.Render(nil) - if err != nil { - t.Fatalf("Error rendering template: %v", err) - } - - if result != tt.expected { - t.Errorf("Expected: %q, Got: %q", tt.expected, result) - } - }) - } -} +// Note: TestCoreWhitespace was removed since whitespace control +// functionality has been intentionally disabled +// (see comments in whitespace.go - "we don't manipulate HTML"). +// This may be reimplemented in the future. // TestCorePool tests memory pooling (render context pool) func TestCorePool(t *testing.T) {