File tree Expand file tree Collapse file tree 10 files changed +51
-18
lines changed Expand file tree Collapse file tree 10 files changed +51
-18
lines changed Original file line number Diff line number Diff line change 1- import { executor } from '../../src/tasks/'
1+ import { runExecutor } from '../../src/tasks/'
22import { expect } from 'chai'
33
44
55describe ( 'run - c' , ( ) => {
66 it ( '.c file runs correctly' , async ( ) => {
7- const runResult = await executor ( {
7+ const runResult = await runExecutor ( {
88 id : 19 ,
99 lang : 'c' ,
1010 source : ( new Buffer ( `
Original file line number Diff line number Diff line change 1- import { executor } from '../../src/tasks/'
1+ import { runExecutor } from '../../src/tasks/'
22import { expect } from 'chai'
33
44
55describe ( 'run - cpp' , ( ) => {
66 it ( '.cpp file runs correctly' , async ( ) => {
7- const runResult = await executor ( {
7+ const runResult = await runExecutor ( {
88 id : 20 ,
99 lang : 'cpp' ,
1010 source : ( new Buffer ( `
Original file line number Diff line number Diff line change 1- import { executor } from '../../src/tasks/'
1+ import { runExecutor } from '../../src/tasks/'
22import { expect } from 'chai'
33
44
55describe ( 'run - csharp' , ( ) => {
66 it ( '.cs file runs correctly' , async ( ) => {
7- const runResult = await executor ( {
7+ const runResult = await runExecutor ( {
88 id : 21 ,
99 lang : 'csharp' ,
1010 source : ( new Buffer ( `
Original file line number Diff line number Diff line change 1- import { executor } from '../../src/tasks/'
1+ import { runExecutor } from '../../src/tasks/'
22import { expect } from 'chai'
33
44
55describe ( 'run - java8' , ( ) => {
66 it ( '.java file runs correctly (Java8)' , async ( ) => {
7- const runResult = await executor ( {
7+ const runResult = await runExecutor ( {
88 id : 22 ,
99 lang : 'java8' ,
1010 source : ( new Buffer ( `
Original file line number Diff line number Diff line change 1- import { executor } from '../../src/tasks/'
1+ import { runExecutor } from '../../src/tasks/'
22import { expect } from 'chai'
33
44
55describe ( 'run - nodejs10' , ( ) => {
66 it ( '.js file runs correctly (NodeJS 6)' , async ( ) => {
7- const runResult = await executor ( {
7+ const runResult = await runExecutor ( {
88 id : 24 ,
99 lang : 'nodejs10' ,
1010 source : ( new Buffer ( `
Original file line number Diff line number Diff line change 1- import { executor } from '../../src/tasks/'
1+ import { runExecutor } from '../../src/tasks/'
22import { expect } from 'chai'
33
44
55describe ( 'run - nodejs8' , ( ) => {
66 it ( '.js file runs correctly (NodeJS 8)' , async ( ) => {
7- const runResult = await executor ( {
7+ const runResult = await runExecutor ( {
88 id : 25 ,
99 lang : 'nodejs8' ,
1010 source : ( new Buffer ( `
Original file line number Diff line number Diff line change 1- import { executor } from '../../src/tasks/'
1+ import { runExecutor } from '../../src/tasks/'
22import { expect } from 'chai'
33
44
55describe ( 'run - py2' , ( ) => {
66 it ( '.py file runs correctly (Python 2.7)' , async ( ) => {
7- const runResult = await executor ( {
7+ const runResult = await runExecutor ( {
88 id : 23 ,
99 lang : 'py2' ,
1010 source : ( new Buffer ( `
Original file line number Diff line number Diff line change 1- import { executor } from '../../src/tasks/'
1+ import { runExecutor } from '../../src/tasks/'
22import { expect } from 'chai'
33
44
55describe ( 'run - py3' , ( ) => {
66 it ( '.py file runs correctly (Python 3.0)' , async ( ) => {
7- const runResult = await executor ( {
7+ const runResult = await runExecutor ( {
88 id : 26 ,
99 lang : 'py3' ,
1010 source : ( new Buffer ( `
Original file line number Diff line number Diff line change 1- import { executor } from '../../src/tasks/'
1+ import { runExecutor } from '../../src/tasks/'
22import { expect } from 'chai'
33
44
55describe ( 'run - ruby' , ( ) => {
66 it ( '.rb file runs correctly' , async ( ) => {
7- const runResult = await executor ( {
7+ const runResult = await runExecutor ( {
88 id : 27 ,
99 lang : 'ruby' ,
1010 source : ( new Buffer ( `
Original file line number Diff line number Diff line change 1+ import { submissionExecutor } from '../../src/tasks/'
2+ import { expect } from 'chai'
3+
4+ describe ( 'submit - cpp' , ( ) => {
5+ it ( '.cpp file submits correctly' , async ( ) => {
6+ const source = `
7+ #include <iostream>
8+ using namespace std;
9+ int main () {
10+ char in[10];
11+ cin>>in;
12+ cout<<"Hello "<<in;
13+ return 0;
14+ }`
15+
16+ const submitResult = await submissionExecutor ( {
17+ id : 1 ,
18+ lang : 'cpp' ,
19+ source : ( new Buffer ( source ) ) . toString ( 'base64' ) ,
20+ testcases : [ {
21+ id : 1 ,
22+ input : 'https://minio.cb.lk/public/input' ,
23+ output : 'https://minio.cb.lk/public/output'
24+ } ]
25+ } )
26+
27+ console . log ( submitResult )
28+
29+ // assertions
30+ expect ( 1 ) . to . eq ( 1 )
31+ } )
32+ } )
33+
You can’t perform that action at this time.
0 commit comments