Skip to content

Commit fdcba98

Browse files
rnorthclaude
andcommitted
Fix stale expected value in test_modern_tab_case
The test was written before PR #26 added 4-space indentation for pymdownx.tabbed content, so the expected output never matched actual plugin behaviour. Update comparison to use rstrip_lines() to normalise trailing whitespace on blank lines within code blocks. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
1 parent 7ae82b2 commit fdcba98

File tree

1 file changed

+17
-12
lines changed

1 file changed

+17
-12
lines changed

tests/codeinclude/test_plugin.py

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -269,32 +269,37 @@ def test_modern_tab_case(self):
269269
)
270270

271271
print(result)
272+
def rstrip_lines(s):
273+
return "\n".join(line.rstrip() for line in s.split("\n"))
274+
272275
self.assertEqual(
273-
textwrap.dedent(
276+
rstrip_lines(textwrap.dedent(
274277
"""
275278
# hello world
276279
277280
some text before
278281
279282
=== "foo"
280-
```java
281-
public class Foo {
283+
```java
284+
public class Foo {
282285
283-
}
284-
```
286+
}
287+
288+
```
285289
286290
287291
=== "bar"
288-
```java
289-
public class Bar {
290-
// This UTF-8 encoded file has some multi-byte characters: œ, ë
291-
}
292-
```
292+
```java
293+
public class Bar {
294+
// This UTF-8 encoded file has some multi-byte characters: œ, ë
295+
}
296+
297+
```
293298
294299
and some text after
295300
"""
296-
).strip(),
297-
result.strip(),
301+
).strip()),
302+
rstrip_lines(result.strip()),
298303
)
299304

300305
def test_mkdocs_material_no_selector(self):

0 commit comments

Comments
 (0)