TestStringStrict.java

package net.minidev.json.test;

import org.junit.jupiter.api.Test;

import net.minidev.json.parser.ParseException;

public class TestStringStrict {

	@Test
	public void testS1() throws Exception {
		String text = "My Test";
		String s = "{t:\"" + text + "\"}";
		MustThrows.testStrictInvalidJson(s, ParseException.ERROR_UNEXPECTED_TOKEN);
	}
	
	@Test
	public void testSEscape() throws Exception {
		String text2 = "My\\r\\nTest";
		String s = "{\"t\":'" + text2 + "'}";
		MustThrows.testStrictInvalidJson(s, ParseException.ERROR_UNEXPECTED_CHAR);
	}
}