-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.js
More file actions
41 lines (37 loc) · 923 Bytes
/
test.js
File metadata and controls
41 lines (37 loc) · 923 Bytes
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
import test from 'ava'
import ssl from './ssl'
test('python hello world', async t => {
const p = ssl({
source_code: 'print("hello world")',
langauge: 'python3'
})
const stdout = await p
t.is(stdout, 'hello world\n')
})
test('python A+B', async t => {
const p = ssl({
source_code: 'print(int(input())+int(input()))',
langauge: 'python3',
stdin: '1010\n101'
})
const stdout = await p
t.is(stdout, '1111\n')
})
test.skip('java runnable', async t => {
const p = ssl({
source_code: `public class supreme{
public static void main(String[] args){
Runnable r = () -> System.out.print("Hello world from thread");
Thread t = new Thread(r);
t.start();
try {
t.join();
} catch (Exception e) {
}
}
}`,
langauge: 'java'
})
const stdout = await p
t.is(stdout, 'Hello world from thread')
})