Skip to main content
summaryrefslogtreecommitdiffstats
blob: 11f4a3981939baff607b39b55c6c741b69700ba3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/*******************************************************************************
 * Copyright (c) 2019 IBM Corporation and others.
 *
 * This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License 2.0
 * which accompanies this distribution, and is available at
 * https://www.eclipse.org/legal/epl-2.0/
 *
 * SPDX-License-Identifier: EPL-2.0
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
package org.eclipse.jdt.core.tests.compiler.regression;

import java.util.Map;

import junit.framework.Test;

import org.eclipse.jdt.internal.compiler.impl.CompilerOptions;

public class Unicode12_1Test extends AbstractRegressionTest {
public Unicode12_1Test(String name) {
	super(name);
}
public static Test suite() {
	return buildMinimalComplianceTestSuite(testClass(), F_13);
}
public void test1() {
	Map<String, String> options = getCompilerOptions();
	options.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_13);
	this.runConformTest(
		new String[] {
			"X.java",
			"public class X {\n" + 
			"		public int a\\uA7BA; // new unicode character in unicode 12.0 \n" + 
			"}",
		},
		"",
		options);
}
public void test2() {
	Map<String, String> options = getCompilerOptions();
	options.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_12);
	this.runNegativeTest(
		new String[] {
			"X.java",
			"public class X {\n" + 
			"		public int a\\uA7BA; // new unicode character in unicode 12.0 \n" + 
			"}",
		},
		"----------\n" + 
		"1. ERROR in X.java (at line 2)\n" + 
		"	public int a\\uA7BA; // new unicode character in unicode 12.0 \n" + 
		"	            ^^^^^^\n" + 
		"Syntax error on token \"Invalid Character\", delete this token\n" + 
		"----------\n",
		null,
		true,
		options);
}
public static Class<Unicode12_1Test> testClass() {
	return Unicode12_1Test.class;
}
}

Back to the top