Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: ae5e6d5ea35bbde9f3db8fcef3c4bb522eeaf1df (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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
/*******************************************************************************
 * Copyright (c) 2014 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * 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;

@SuppressWarnings({ "unchecked", "rawtypes" })
public class Unicode18Test extends AbstractRegressionTest {
public Unicode18Test(String name) {
	super(name);
}
public static Test suite() {
	return buildMinimalComplianceTestSuite(testClass(), F_1_8);
}
public void test426214() {
	Map options = getCompilerOptions();
	options.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_8);
	this.runConformTest(
		new String[] {
			"X.java",
			"public class X {\n" + 
			"		int a\\u058f = 0; // new unicode character in 6.2.0 \n" + 
			"		String a41\\u08fc; // new unicode character in 6.2.0\n" + 
			"		float a\\u057f = 1;\n" + 
			"}",
		},
		"",
		options);
}
public void test426214_2() {
	Map options = getCompilerOptions();
	options.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_7);
	this.runNegativeTest(
		new String[] {
			"X.java",
			"public class X {\n" + 
			"		int a\\u058f = 0; // new unicode character in 6.2.0 \n" + 
			"		String a41\\u08fc; // new unicode character in 6.2.0\n" + 
			"		float a\\u057f = 1;\n" + 
			"}",
		},
		"----------\n" + 
		"1. ERROR in X.java (at line 2)\n" + 
		"	int a\\u058f = 0; // new unicode character in 6.2.0 \n" + 
		"	     ^^^^^^\n" + 
		"Syntax error on token \"Invalid Character\", delete this token\n" + 
		"----------\n" + 
		"2. ERROR in X.java (at line 3)\n" + 
		"	String a41\\u08fc; // new unicode character in 6.2.0\n" + 
		"	          ^^^^^^\n" + 
		"Syntax error on token \"Invalid Character\", delete this token\n" + 
		"----------\n",
		null,
		true,
		options);
}
public void test426214_3() {
	Map options = getCompilerOptions();
	options.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_6);
	this.runNegativeTest(
		new String[] {
			"X.java",
			"public class X {\n" + 
			"		int a\\u058f = 0; // new unicode character in 6.2.0 \n" + 
			"		String a41\\u08fc; // new unicode character in 6.2.0\n" + 
			"		float a\\u057f = 1;\n" + 
			"}",
		},
		"----------\n" + 
		"1. ERROR in X.java (at line 2)\n" + 
		"	int a\\u058f = 0; // new unicode character in 6.2.0 \n" + 
		"	     ^^^^^^\n" + 
		"Syntax error on token \"Invalid Character\", delete this token\n" + 
		"----------\n" + 
		"2. ERROR in X.java (at line 3)\n" + 
		"	String a41\\u08fc; // new unicode character in 6.2.0\n" + 
		"	          ^^^^^^\n" + 
		"Syntax error on token \"Invalid Character\", delete this token\n" + 
		"----------\n",
		null,
		true,
		options);
}
public void test426214_4() {
	Map options = getCompilerOptions();
	options.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_8);
	this.runNegativeTest(
		new String[] {
			"X.java",
			"public class X {\n" + 
			"		int a\\u061C = 0; // new unicode character in 6.3.0 \n" + 
			"}",
		},
		"----------\n" + 
		"1. ERROR in X.java (at line 2)\n" + 
		"	int a\\u061C = 0; // new unicode character in 6.3.0 \n" + 
		"	     ^^^^^^\n" + 
		"Syntax error on token \"Invalid Character\", delete this token\n" + 
		"----------\n",
		null,
		true,
		options);
}
public static Class testClass() {
	return Unicode18Test.class;
}
}

Back to the top