-
Notifications
You must be signed in to change notification settings - Fork 664
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
e54b224
commit 37ffe88
Showing
2 changed files
with
29 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
if (typeof exports === 'object') { | ||
var assert = require('assert'); | ||
var alasql = require('..'); | ||
} else { | ||
__dirname = '.'; | ||
} | ||
|
||
describe('Test 1820 - SELECT query (a AS b, b AS c)', function () { | ||
|
||
it('1. Select query where alias of one column is also a column name in the result set', function (done) { | ||
let item1 = { a: 1, b: "hello" }; | ||
let item2 = { a: 2, b: "" }; | ||
|
||
var res = alasql('SELECT a as b, b as c FROM ? GROUP BY a,b', [[item1, item2]]); | ||
|
||
assert.deepEqual(res, [{ | ||
b: 1, | ||
c: "hello" | ||
}, { | ||
b: 2, | ||
c: "" | ||
}]); | ||
|
||
done(); | ||
}); | ||
}); |