From 60d8dd08695d12696903b2574e733c5488d7894c Mon Sep 17 00:00:00 2001 From: VibhorCodecianGupta Date: Thu, 2 Aug 2018 23:12:31 +0530 Subject: [PATCH] perl spec --- config.js | 7 ++++++- test/run.perl.spec.ts | 19 +++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 test/run.perl.spec.ts diff --git a/config.js b/config.js index e0d814a..7c9e07c 100644 --- a/config.js +++ b/config.js @@ -53,6 +53,11 @@ exports = module.exports = { SOURCE_FILE: 'script.rb', CPU_SHARE: "0.8", MEM_LIMIT: '300m' + }, + 'perl': { + SOURCE_FILE: 'script.pl', + CPU_SHARE: "0.8", + MEM_LIMIT: '300m' } } -} \ No newline at end of file +} diff --git a/test/run.perl.spec.ts b/test/run.perl.spec.ts new file mode 100644 index 0000000..897677d --- /dev/null +++ b/test/run.perl.spec.ts @@ -0,0 +1,19 @@ +import {execRun} from '../src/tasks/run' +import {expect} from 'chai' + + +describe('run - perl', () => { + it('.pl file runs correctly', () => { + execRun({ + id: 28, + lang: 'perl', + source: (new Buffer(` + $input = ; + print "Hello '$input'"; + `)).toString('base64'), + stdin: (new Buffer('World')).toString('base64') + }, (runResult) => { + expect(new Buffer(runResult.stdout, 'base64').toString('ascii')).to.eq('Hello World\n') + }) + }) +})