Skip to content

Commit f6a14b3

Browse files
committed
Non-working unit test for xtext#8.
1 parent eceaa9b commit f6a14b3

File tree

1 file changed

+39
-17
lines changed

1 file changed

+39
-17
lines changed

src/test/java/de/itemis/xtend/auto/gwt/JsNativeTest.xtend

Lines changed: 39 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,45 @@ import org.eclipse.xtend.core.compiler.batch.XtendCompilerTester
44
import org.junit.Test
55

66
class JsNativeTest {
7-
7+
88
extension XtendCompilerTester compiler = XtendCompilerTester.newXtendCompilerTester(JsNativeTest)
9-
9+
1010
@Test def void testSimple() {
11-
// '''
12-
// package foo
13-
//
14-
// import «JsNative.name»
15-
//
16-
// class MyJsNativeCode {
17-
// @JsNative def String doStuff(String param1) ''«»'
18-
// // some javascript code here
19-
// ''«»'
20-
// }
21-
//
22-
// '''.assertCompilesTo('''
23-
//
24-
// ''')
25-
}
11+
'''
12+
import «JsNative.name»
13+
14+
class C /* extends JavaScriptObject */ {
15+
protected new() {
16+
}
17+
18+
@JsNative
19+
def void a() '«»''
20+
this.a();
21+
'«»''
22+
23+
@JsNative
24+
def void b() '«»''
25+
this.b();
26+
'«»''
27+
}
28+
'''.assertCompilesTo('''
29+
import de.itemis.xtend.auto.gwt.JsNative;
30+
31+
@SuppressWarnings("all")
32+
public class C {
33+
protected C() {
34+
}
35+
36+
@JsNative
37+
public final native void a() /*-{
38+
this.a();
39+
}-*/;
40+
41+
@JsNative
42+
public final native void b() /*-{
43+
this.b();
44+
}-*/;
45+
}
46+
''')
47+
}
2648
}

0 commit comments

Comments
 (0)