Skip to content

Commit ded70f5

Browse files
Merge pull request #15 from kapillamba4/csharp-spec
Add support for csharp
2 parents 1c30b81 + c61bf19 commit ded70f5

File tree

5 files changed

+32
-2
lines changed

5 files changed

+32
-2
lines changed

.travis.yml

+1
Original file line numberDiff line numberDiff 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-csharp
1516
- docker pull codingblocks/judge-worker-java8
1617
- docker pull codingblocks/judge-worker-py2
1718
- docker pull codingblocks/judge-worker-py3

config.js

+5
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ exports = module.exports = {
2424
CPU_SHARE: "0.5",
2525
MEM_LIMIT: '100m'
2626
},
27+
'csharp': {
28+
SOURCE_FILE: 'program.cs',
29+
CPU_SHARE: '1.2',
30+
MEM_LIMIT: '500m',
31+
},
2732
'py2': {
2833
SOURCE_FILE: 'script.py',
2934
CPU_SHARE: "0.8",

test/run.c.spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {expect} from 'chai'
55
describe('run - c', () => {
66
it('.c file runs correctly', () => {
77
execRun({
8-
id: 20,
8+
id: 19,
99
lang: 'c',
1010
source: (new Buffer(`
1111
#include <stdio.h>

test/run.cpp.spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {expect} from 'chai'
55
describe('run - cpp', () => {
66
it('.cpp file runs correctly', () => {
77
execRun({
8-
id: 21,
8+
id: 20,
99
lang: 'cpp',
1010
source: (new Buffer(`
1111
#include <iostream>

test/run.csharp.spec.ts

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import {execRun} from '../src/tasks/run'
2+
import {expect} from 'chai'
3+
4+
5+
describe('run - csharp', () => {
6+
it('.cs file runs correctly', () => {
7+
execRun({
8+
id: 21,
9+
lang: 'csharp',
10+
source: (new Buffer(`
11+
using System;
12+
13+
public class HelloWorld {
14+
static public void Main () {
15+
Console.WriteLine ("Hello " + Console.ReadLine());
16+
}
17+
}
18+
`)).toString('base64'),
19+
stdin: (new Buffer('World')).toString('base64')
20+
}, (runResult) => {
21+
expect(new Buffer(runResult.stdout, 'base64').toString('ascii')).to.eq('Hello World\n')
22+
})
23+
})
24+
})

0 commit comments

Comments
 (0)