// This can't be round-tripped
public void testNoInitialWhiteSpace() {
try {
new ProcessingInstruction("target", " initial spaces");
fail("allowed processing instruction data with leading space");
}
catch (IllegalDataException success) {
assertEquals(" initial spaces", success.getData());
assertNotNull(success.getMessage());
}
try {
new ProcessingInstruction("target", "\tinitial tab");
fail("allowed processing instruction data with leading space");
}
catch (IllegalDataException success) {
assertEquals("\tinitial tab", success.getData());
assertNotNull(success.getMessage());
}
try {
new ProcessingInstruction("target", "\ninitial linefeed");
fail("allowed processing instruction data with leading space");
}
catch (IllegalDataException success) {
assertEquals("\ninitial linefeed", success.getData());
assertNotNull(success.getMessage());
}
try {
new ProcessingInstruction("target", "\r initial carriage return");
fail("allowed processing instruction data with leading space");
}
catch (IllegalDataException success) {
assertEquals("\r initial carriage return", success.getData());
assertNotNull(success.getMessage());