Skip to content

Commit

Permalink
Improve code coverage
Browse files Browse the repository at this point in the history
HEALTHCHECK commands may be a little long depending on what the CMD
needs to do. Thus, we should test that escaped newlines are being
handled properly and that no proposals will appear even on an escaped
newline as long as the text cursor is effectively after a CMD or a
NONE.

Signed-off-by: Remy Suen <[email protected]>
  • Loading branch information
rcjsuen committed Jul 19, 2017
1 parent c43ae4b commit d5753fe
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions test/dockerAssist.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1395,6 +1395,18 @@ describe('Docker Content Assist Tests', function() {
items = computePosition("FROM busybox\nHEALTHCHECK cmd ", 1, 16, snippetSupport);
assert.equal(items.length, 0);

items = computePosition("FROM busybox\nHEALTHCHECK CMD\\\n", 2, 0, snippetSupport);
assert.equal(items.length, 0);

items = computePosition("FROM busybox\nHEALTHCHECK cmd\\\n", 2, 0, snippetSupport);
assert.equal(items.length, 0);

items = computePosition("FROM busybox\nHEALTHCHECK CMD \\\n", 2, 0, snippetSupport);
assert.equal(items.length, 0);

items = computePosition("FROM busybox\nHEALTHCHECK cmd \\\n", 2, 0, snippetSupport);
assert.equal(items.length, 0);

items = computePosition("FROM busybox\nHEALTHCHECK NONE", 1, 16, snippetSupport);
assert.equal(items.length, 0);

Expand All @@ -1406,6 +1418,18 @@ describe('Docker Content Assist Tests', function() {

items = computePosition("FROM busybox\nHEALTHCHECK none ", 1, 17, snippetSupport);
assert.equal(items.length, 0);

items = computePosition("FROM busybox\nHEALTHCHECK NONE \\\n", 2, 0, snippetSupport);
assert.equal(items.length, 0);

items = computePosition("FROM busybox\nHEALTHCHECK none \\\n", 2, 0, snippetSupport);
assert.equal(items.length, 0);

items = computePosition("FROM busybox\nHEALTHCHECK NONE\\\n", 2, 0, snippetSupport);
assert.equal(items.length, 0);

items = computePosition("FROM busybox\nHEALTHCHECK none\\\n", 2, 0, snippetSupport);
assert.equal(items.length, 0);
});
});
}
Expand Down

0 comments on commit d5753fe

Please sign in to comment.