forked from runtimeverification/k
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathKompileFrontEndTest.java
More file actions
50 lines (38 loc) · 1.45 KB
/
KompileFrontEndTest.java
File metadata and controls
50 lines (38 loc) · 1.45 KB
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
// Copyright (c) 2014-2019 K Team. All Rights Reserved.
package org.kframework.kompile;
import com.google.inject.util.Providers;
import org.junit.Test;
import org.kframework.utils.IOTestCase;
import org.kframework.utils.file.FileUtil;
import org.kframework.utils.file.JarInfo;
import org.mockito.Mock;
import java.io.IOException;
import static org.junit.Assert.*;
import static org.mockito.Mockito.*;
public class KompileFrontEndTest extends IOTestCase {
@Mock
org.kframework.compile.Backend koreBackend;
@Mock
JarInfo jarInfo;
@Mock
FileUtil files;
KompileOptions options = new KompileOptions();
@Test
public void testHelp() throws IOException {
options.global.help = true;
new KompileFrontEnd(options, "foo", "", Providers.of(koreBackend), sw, kem, loader, jarInfo, Providers.of(files)).main();
assertEquals("foo", stdout.toString());
}
@Test
public void testExperimentalHelp() throws IOException {
options.global.helpExperimental = true;
new KompileFrontEnd(options, "", "foo", Providers.of(koreBackend), sw, kem, loader, jarInfo, Providers.of(files)).main();
assertEquals("foo", stdout.toString());
}
@Test
public void testVersion() {
options.global.version = true;
new KompileFrontEnd(options, "", "foo", Providers.of(koreBackend), sw, kem, loader, jarInfo, Providers.of(files)).main();
verify(jarInfo).printVersionMessage();
}
}