Skip to content

Commit

Permalink
Fix tests, pipeline for PR #61
Browse files Browse the repository at this point in the history
  • Loading branch information
heaths authored Dec 9, 2022
1 parent 3efdb8d commit 29744f8
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 8 deletions.
9 changes: 8 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,17 @@ jobs:
check:
needs: build
runs-on: ubuntu-latest
if: ${{ !cancelled() }}

steps:
- name: Check
run: echo "All required checks passed"
run: |
if [[ "${{ needs.build.result }}" == "success" ]]; then
echo -e "\e[32mSuccess\e[0m"
else
echo -e "\e[31mFailed\e[0m"
exit 1
fi
publish:
needs: build
Expand Down
26 changes: 19 additions & 7 deletions src/test/commands.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ suite('GuidCommands', () => {
var g = new Guid('12341234-1234-1234-1234-123412341234');
var items = GuidCommands.getQuickPickItems(g, true, false, true);

assert.strictEqual(items.length, 5);
assert.strictEqual(items.length, 6);

var item = items[0];
assert.strictEqual(item.label, '1');
Expand All @@ -41,7 +41,7 @@ suite('GuidCommands', () => {
var g = new Guid('12341234-1234-1234-1234-123412341234');
var items = GuidCommands.getQuickPickItems(g, true, false, true);

assert.strictEqual(items.length, 5);
assert.strictEqual(items.length, 6);

var item = items[1];
assert.strictEqual(item.label, '2');
Expand All @@ -53,7 +53,7 @@ suite('GuidCommands', () => {
var g = new Guid('12341234-1234-1234-1234-123412341234');
var items = GuidCommands.getQuickPickItems(g, true, false, true);

assert.strictEqual(items.length, 5);
assert.strictEqual(items.length, 6);

var item = items[2];
assert.strictEqual(item.label, '3');
Expand All @@ -70,7 +70,7 @@ suite('GuidCommands', () => {
var g = new Guid('12341234-1234-1234-1234-123412341234');
var items = GuidCommands.getQuickPickItems(g, true, false, true);

assert.strictEqual(items.length, 5);
assert.strictEqual(items.length, 6);

var item = items[3];
assert.strictEqual(item.label, '4');
Expand All @@ -87,19 +87,31 @@ suite('GuidCommands', () => {
var g = new Guid('12341234-1234-1234-1234-123412341234');
var items = GuidCommands.getQuickPickItems(g, true, false, true);

assert.strictEqual(items.length, 5);
assert.strictEqual(items.length, 6);

var item = items[4];
assert.strictEqual(item.label, '5');
assert.strictEqual(item.description, '12341234123412341234123412341234');
assert.strictEqual(item.text, '12341234123412341234123412341234');
});

test('quick pick 6 is struct-like GUID', () => {
var g = new Guid('12341234-1234-1234-1234-123412341234');
var items = GuidCommands.getQuickPickItems(g, true, false, true);

assert.strictEqual(items.length, 6);

var item = items[5];
assert.strictEqual(item.label, '6');
assert.strictEqual(item.description, '{0x12341234, 0x1234, 0x1234, {0x12, 0x34, 0x12, 0x34, 0x12, 0x34, 0x12, 0x34}}');
assert.strictEqual(item.text, '{0x12341234, 0x1234, 0x1234, {0x12, 0x34, 0x12, 0x34, 0x12, 0x34, 0x12, 0x34}}');
});

test('quick pick items are correct when all settings are true', () => {
const g = new Guid('12341234-dead-beef-1234-123412341234');
const items = GuidCommands.getQuickPickItems(g, true, true, true);

assert.strictEqual(items.length, 8);
assert.strictEqual(items.length, 9);

const item1 = items[0];
assert.strictEqual(item1.label, '1');
Expand Down Expand Up @@ -201,7 +213,7 @@ suite('GuidCommands', () => {
const g = new Guid('12341234-dead-beef-1234-123412341234');
const items = GuidCommands.getQuickPickItems(g, false, false, true);

assert.strictEqual(items.length, 2);
assert.strictEqual(items.length, 3);

const item1 = items[0];
assert.strictEqual(item1.label, '1');
Expand Down

0 comments on commit 29744f8

Please sign in to comment.