flexmark-java
flexmark-java copied to clipboard
Document.toString()
Describe the bug
Currently Document.toString() does not appear to be implemented (properly).
Simple test case:
package com.vladsch.flexmark.util.ast;
import static org.junit.jupiter.api.Assertions.assertNotEquals;
import com.vladsch.flexmark.parser.Parser;
import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Test;
final class DocumentTest {
@Nested
class toString {
@Test
void differentObjectsNotEqualString() {
final Parser parser = Parser.builder().build();
final Document a = parser.parse("a");
final Document b = parser.parse("b");
assertNotEquals(
a.toString(), b.toString(), "Expected toString() to be different for different objects.");
}
}
}
In both cases, Document{} is returned.
A more advanced test can be implemented using the ToStringVerifier library.
Please implement toString on the Document class, and related classes.