mirror of https://github.com/lukechilds/node.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
512 B
20 lines
512 B
8 years ago
|
'use strict';
|
||
|
|
||
|
const common = require('../common');
|
||
|
|
||
|
const URL = require('url').URL;
|
||
|
const path = require('path');
|
||
|
const assert = require('assert');
|
||
|
const tests = require(path.join(common.fixturesDir, 'url-tests.json'));
|
||
|
|
||
|
for (const test of tests) {
|
||
|
if (typeof test === 'string')
|
||
|
continue;
|
||
|
|
||
|
if (test.origin) {
|
||
|
const origin = URL.originFor(test.input, test.base);
|
||
|
// Pass true to origin.toString() to enable unicode serialization.
|
||
|
assert.strictEqual(origin.toString(true), test.origin);
|
||
|
}
|
||
|
}
|