Skip to content

Commit 475e2e0

Browse files
VibhorCodecianGuptaVibhorCodecianGupta
VibhorCodecianGupta
authored and
VibhorCodecianGupta
committed
added go spec
1 parent 1c30b81 commit 475e2e0

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

test/run.go.spec.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
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+
})

0 commit comments

Comments
 (0)