(t *testing.T)
| 250 | } |
| 251 | |
| 252 | func TestWriteJavaScriptToYAMLProducesValidIndentation(t *testing.T) { |
| 253 | script := "const x = 1;\nif (x > 0) {\n console.log('positive');\n}" |
| 254 | var yaml strings.Builder |
| 255 | WriteJavaScriptToYAML(&yaml, script) |
| 256 | result := yaml.String() |
| 257 | |
| 258 | lines := strings.Split(result, "\n") |
| 259 | // Remove last empty line from split |
| 260 | if lines[len(lines)-1] == "" { |
| 261 | lines = lines[:len(lines)-1] |
| 262 | } |
| 263 | |
| 264 | // Check that all lines start with proper indentation (12 spaces) |
| 265 | for i, line := range lines { |
| 266 | if !strings.HasPrefix(line, " ") { |
| 267 | t.Errorf("Line %d does not start with proper indentation: %q", i, line) |
| 268 | } |
| 269 | } |
| 270 | } |
| 271 | |
| 272 | func TestJavaScriptFormattingConsistency(t *testing.T) { |
| 273 | // Test that both functions produce equivalent output |
nothing calls this directly
no test coverage detected