Skip to content

Commit

Permalink
Fix #36 Add some extra tests
Browse files Browse the repository at this point in the history
Signed-off-by: Remy Suen <[email protected]>
  • Loading branch information
rcjsuen committed May 19, 2018
1 parent 5162f47 commit a4f43d9
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/dockerValidator.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1806,11 +1806,17 @@ describe("Docker Validator Tests", function() {
let diagnostics = validateDockerfile("FROM node\nARG AAA=${aaa:-'bbb'}");
assert.equal(diagnostics.length, 0);

diagnostics = validateDockerfile("FROM node\nARG AAA=${aaa:-'bbb ccc'}");
assert.equal(diagnostics.length, 0);

diagnostics = validateDockerfile("FROM node\nARG AAA=${aaa:-\"bbb\"");
assert.equal(diagnostics.length, 0);

diagnostics = validateDockerfile("FROM node\nARG AAA=${aaa:-\"bbb\"}");
assert.equal(diagnostics.length, 0);

diagnostics = validateDockerfile("FROM node\nARG AAA=${aaa:-\"bbb ccc\"}");
assert.equal(diagnostics.length, 0);
});

it("escape", function() {
Expand Down Expand Up @@ -2192,11 +2198,17 @@ describe("Docker Validator Tests", function() {
diagnostics = validateDockerfile("FROM node\n" + instruction + " AAA=${aaa:-'bbb'}");
assert.equal(diagnostics.length, 0);

diagnostics = validateDockerfile("FROM node\n" + instruction + " AAA=${aaa:-'bbb ccc'}");
assert.equal(diagnostics.length, 0);

diagnostics = validateDockerfile("FROM node\n" + instruction + " AAA=${aaa:-\"bbb\"");
assert.equal(diagnostics.length, 0);

diagnostics = validateDockerfile("FROM node\n" + instruction + " AAA=${aaa:-\"bbb\"}");
assert.equal(diagnostics.length, 0);

diagnostics = validateDockerfile("FROM node\n" + instruction + " AAA=${aaa:-\"bbb ccc\"}");
assert.equal(diagnostics.length, 0);
});

it("requires two", function() {
Expand Down

0 comments on commit a4f43d9

Please sign in to comment.