File tree Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Original file line number Diff line number Diff line change 1+ import { execute } from '../../src/tasks/'
2+ import { expect } from 'chai'
3+ import { SubmitJob } from '../../src/tasks/job'
4+ import { SubmissionResult } from '../../src/types/result'
5+
6+ describe ( 'submit - c' , ( ) => {
7+ it ( '.c file submits correctly' , async ( ) => {
8+ const source = `
9+ #include <stdio.h>
10+ int main () {
11+ char in[10];
12+ scanf("%s", in);
13+ printf("Hello %s", in);
14+ return 0;
15+ }
16+ `
17+
18+ const submitResult = await execute ( new SubmitJob ( {
19+ id : 1 ,
20+ lang : 'c' ,
21+ source : ( new Buffer ( source ) ) . toString ( 'base64' ) ,
22+ testcases : [ {
23+ id : 1 ,
24+ input : 'https://minio.cb.lk/public/input' ,
25+ output : 'https://minio.cb.lk/public/output'
26+ } ]
27+ } ) )
28+
29+ console . log ( submitResult )
30+
31+ // assertions
32+ expect ( submitResult . testcases [ 0 ] . result ) . to . eq ( 'Success' )
33+ expect ( submitResult . testcases [ 0 ] . score ) . to . eq ( 100 )
34+ } )
35+ } )
36+
You can’t perform that action at this time.
0 commit comments