File tree Expand file tree Collapse file tree 3 files changed +33
-1
lines changed Expand file tree Collapse file tree 3 files changed +33
-1
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ install:
1212 - npm install -D
1313 - docker pull codingblocks/judge-worker-c
1414 - docker pull codingblocks/judge-worker-cpp
15+ - docker pull codingblocks/judge-worker-golang
1516 - docker pull codingblocks/judge-worker-java8
1617 - docker pull codingblocks/judge-worker-py2
1718 - docker pull codingblocks/judge-worker-py3
Original file line number Diff line number Diff line change @@ -48,6 +48,11 @@ exports = module.exports = {
4848 SOURCE_FILE : 'script.rb' ,
4949 CPU_SHARE : "0.8" ,
5050 MEM_LIMIT : '300m'
51+ } ,
52+ 'golang' : {
53+ SOURCE_FILE : 'main.go' ,
54+ CPU_SHARE : "0.8" ,
55+ MEM_LIMIT : '300m'
5156 }
5257 }
53- }
58+ }
Original file line number Diff line number Diff line change 1+ import { execRun } from '../src/tasks/run'
2+ import { expect } from 'chai'
3+
4+ describe ( 'run - golang' , ( ) => {
5+ it ( '.go file runs correctly' , ( ) => {
6+ execRun ( {
7+ id : 28 ,
8+ lang : 'golang' ,
9+ source : ( new Buffer ( `
10+ package main;
11+
12+ import "fmt";
13+
14+ func main() {
15+ var text string
16+ fmt.Scanf("%s", &text)
17+ fmt.Println("Hello " + text)
18+ }
19+
20+ ` ) ) . toString ( 'base64' ) ,
21+ stdin : ( new Buffer ( 'World' ) ) . toString ( 'base64' )
22+ } , ( runResult ) => {
23+ expect ( new Buffer ( runResult . stdout , 'base64' ) . toString ( 'ascii' ) ) . to . eq ( 'Hello World' )
24+ } )
25+ } )
26+ } )
You can’t perform that action at this time.
0 commit comments