Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

Commit

Permalink
tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ramya-rao-a committed Apr 4, 2018
1 parent f915b8f commit bbf329c
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions test/go.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -703,13 +703,34 @@ It returns the number of bytes written and any write error encountered.
}
}
});
let configWithIncludeGoroot = Object.create(vscode.workspace.getConfiguration('go'), {
'gotoSymbol': {
value: {
'includeGoroot': true
}
}
});
let configWithoutIncludeGoroot = Object.create(vscode.workspace.getConfiguration('go'), {
'gotoSymbol': {
value: {
'includeGoroot': false
}
}
});
let withoutIgnoringFolders = getSymbols(workspacePath, 'WinInfo', null, configWithoutIgnoringFolders).then(results => {
assert.equal(results[0].name, 'WinInfo');
assert.equal(results[0].path, path.join(workspacePath, 'vendor/9fans.net/go/acme/acme.go'));
});
let withIgnoringFolders = getSymbols(workspacePath, 'WinInfo', null, configWithIgnoringFolders).then(results => {
assert.equal(results.length, 0);
});
let withoutIncludingGoroot = getSymbols(workspacePath, 'printf', null, configWithoutIncludeGoroot).then(results => {
assert.equal(results.length, 0);
});
let withIncludingGoroot = getSymbols(workspacePath, 'WinInfo', null, configWithIncludeGoroot).then(results => {
assert.equal(results[0].name, 'printf');
});

Promise.all([withIgnoringFolders, withoutIgnoringFolders]).then(() => done(), done);
});

Expand Down

0 comments on commit bbf329c

Please sign in to comment.