Skip to content
/ labels Public
  • Sponsor pelias/labels

  • Notifications You must be signed in to change notification settings
  • Fork 9
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: pelias/labels
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 12ab8d08b7f6c854f15bbb2a4c0105b7b8639ef2
Choose a base ref
..
head repository: pelias/labels
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 73ef845cfc09e19ff6aa40ed2418995da7bd0d15
Choose a head ref
Showing with 60 additions and 40 deletions.
  1. +26 −23 test/labelGenerator_FRA.js
  2. +26 −13 test/labelGenerator_GBR.js
  3. +8 −4 test/labelGenerator_JPN_JPN.js
49 changes: 26 additions & 23 deletions test/labelGenerator_FRA.js
Original file line number Diff line number Diff line change
@@ -38,7 +38,7 @@ module.exports.tests.united_kingdom = function(test, common) {
],
separator: ', ',
});
t.end();
t.end();
});

test('overseas: venue', function(t) {
@@ -68,7 +68,7 @@ module.exports.tests.united_kingdom = function(test, common) {
],
separator: ', ',
});
t.end();
t.end();
});

test('localadmin value should be used when locality is not available', function(t) {
@@ -97,7 +97,7 @@ module.exports.tests.united_kingdom = function(test, common) {
],
separator: ', ',
});
t.end();
t.end();
});

test('overseas: localadmin value should be used when locality is not available', function(t) {
@@ -126,7 +126,7 @@ module.exports.tests.united_kingdom = function(test, common) {
],
separator: ', ',
});
t.end();
t.end();
});

test('street', function(t) {
@@ -155,7 +155,7 @@ module.exports.tests.united_kingdom = function(test, common) {
],
separator: ', ',
});
t.end();
t.end();
});

test('overseas: street', function(t) {
@@ -184,7 +184,7 @@ module.exports.tests.united_kingdom = function(test, common) {
],
separator: ', ',
});
t.end();
t.end();
});

test('neighbourhood', function(t) {
@@ -211,7 +211,7 @@ module.exports.tests.united_kingdom = function(test, common) {
],
separator: ', ',
});
t.end();
t.end();
});

test('overseas: neighbourhood', function(t) {
@@ -238,7 +238,7 @@ module.exports.tests.united_kingdom = function(test, common) {
],
separator: ', ',
});
t.end();
t.end();
});

test('locality', function(t) {
@@ -263,7 +263,7 @@ module.exports.tests.united_kingdom = function(test, common) {
],
separator: ', ',
});
t.end();
t.end();
});

test('overseas: locality', function(t) {
@@ -288,7 +288,7 @@ module.exports.tests.united_kingdom = function(test, common) {
],
separator: ', ',
});
t.end();
t.end();
});

test('localadmin', function(t) {
@@ -312,7 +312,7 @@ module.exports.tests.united_kingdom = function(test, common) {
],
separator: ', ',
});
t.end();
t.end();
});

test('overseas: localadmin', function(t) {
@@ -336,7 +336,7 @@ module.exports.tests.united_kingdom = function(test, common) {
],
separator: ', ',
});
t.end();
t.end();
});

test('county', function(t) {
@@ -359,7 +359,7 @@ module.exports.tests.united_kingdom = function(test, common) {
],
separator: ', ',
});
t.end();
t.end();
});

test('overseas: county', function(t) {
@@ -382,7 +382,7 @@ module.exports.tests.united_kingdom = function(test, common) {
],
separator: ', ',
});
t.end();
t.end();
});

test('macrocounty', function(t) {
@@ -404,7 +404,7 @@ module.exports.tests.united_kingdom = function(test, common) {
],
separator: ', ',
});
t.end();
t.end();
});

test('overseas: macrocounty', function(t) {
@@ -426,7 +426,7 @@ module.exports.tests.united_kingdom = function(test, common) {
],
separator: ', ',
});
t.end();
t.end();
});

test('region', function(t) {
@@ -446,7 +446,7 @@ module.exports.tests.united_kingdom = function(test, common) {
],
separator: ', ',
});
t.end();
t.end();
});

test('overseas: region', function(t) {
@@ -464,7 +464,7 @@ module.exports.tests.united_kingdom = function(test, common) {
labelParts: [{ label: 'Reunion', role: 'required', layer: 'name' }],
separator: ', ',
});
t.end();
t.end();
});

test('macroregion', function(t) {
@@ -483,7 +483,7 @@ module.exports.tests.united_kingdom = function(test, common) {
],
separator: ', ',
});
t.end();
t.end();
});

test('dependency', function(t) {
@@ -500,7 +500,7 @@ module.exports.tests.united_kingdom = function(test, common) {
labelParts: [{ label: 'dependency name', role: 'required', layer: 'name' }],
separator: ', ',
});
t.end();
t.end();
});

test('country', function(t) {
@@ -512,8 +512,11 @@ module.exports.tests.united_kingdom = function(test, common) {
'country': ['France']
};
t.equal(generator(doc),'France');
t.deepEqual(partsGenerator(doc), { labelParts: [{ label: 'France', role: 'required', layer: 'country' }], separator: ', ' });
t.end();
t.deepEqual(partsGenerator(doc), {
labelParts: [{ label: 'France', role: 'required', layer: 'country' }],
separator: ', ',
});
t.end();
});

test('locality with dependency should ignore country', function(t) {
@@ -539,7 +542,7 @@ module.exports.tests.united_kingdom = function(test, common) {
],
separator: ', ',
});
t.end();
t.end();
});

};
39 changes: 26 additions & 13 deletions test/labelGenerator_GBR.js
Original file line number Diff line number Diff line change
@@ -37,7 +37,8 @@ module.exports.tests.united_kingdom = function(test, common) {
{ label: 'United Kingdom', role: 'required', layer: 'country' },
],
separator: ', ',
}); t.end();
});
t.end();
});

test('localadmin value should be used when locality is not available', function(t) {
@@ -65,7 +66,8 @@ module.exports.tests.united_kingdom = function(test, common) {
{ label: 'United Kingdom', role: 'required', layer: 'country' },
],
separator: ', ',
}); t.end();
});
t.end();
});

test('street', function(t) {
@@ -93,7 +95,8 @@ module.exports.tests.united_kingdom = function(test, common) {
{ label: 'United Kingdom', role: 'required', layer: 'country' },
],
separator: ', ',
}); t.end();
});
t.end();
});

test('neighbourhood', function(t) {
@@ -119,7 +122,8 @@ module.exports.tests.united_kingdom = function(test, common) {
{ label: 'United Kingdom', role: 'required', layer: 'country' },
],
separator: ', ',
}); t.end();
});
t.end();
});

test('locality', function(t) {
@@ -143,7 +147,8 @@ module.exports.tests.united_kingdom = function(test, common) {
{ label: 'United Kingdom', role: 'required', layer: 'country' },
],
separator: ', ',
}); t.end();
});
t.end();
});

test('localadmin', function(t) {
@@ -166,7 +171,8 @@ module.exports.tests.united_kingdom = function(test, common) {
{ label: 'United Kingdom', role: 'required', layer: 'country' },
],
separator: ', ',
}); t.end();
});
t.end();
});

test('county', function(t) {
@@ -188,7 +194,8 @@ module.exports.tests.united_kingdom = function(test, common) {
{ label: 'United Kingdom', role: 'required', layer: 'country' },
],
separator: ', ',
}); t.end();
});
t.end();
});

test('macrocounty', function(t) {
@@ -209,7 +216,8 @@ module.exports.tests.united_kingdom = function(test, common) {
{ label: 'United Kingdom', role: 'required', layer: 'country' },
],
separator: ', ',
}); t.end();
});
t.end();
});

test('region', function(t) {
@@ -229,7 +237,8 @@ module.exports.tests.united_kingdom = function(test, common) {
{ label: 'United Kingdom', role: 'required', layer: 'country' },
],
separator: ', ',
}); t.end();
});
t.end();
});

test('macroregion', function(t) {
@@ -247,7 +256,8 @@ module.exports.tests.united_kingdom = function(test, common) {
{ label: 'United Kingdom', role: 'required', layer: 'country' },
],
separator: ', ',
}); t.end();
});
t.end();
});

test('dependency', function(t) {
@@ -263,7 +273,8 @@ module.exports.tests.united_kingdom = function(test, common) {
t.deepEqual(partsGenerator(doc), {
labelParts: [{ label: 'dependency name', role: 'required', layer: 'name' }],
separator: ', ',
}); t.end();
});
t.end();
});

test('country', function(t) {
@@ -278,7 +289,8 @@ module.exports.tests.united_kingdom = function(test, common) {
t.deepEqual(partsGenerator(doc), {
labelParts: [{ label: 'United Kingdom', role: 'required', layer: 'country' }],
separator: ', ',
}); t.end();
});
t.end();
});

test('locality with dependency should ignore country', function(t) {
@@ -303,7 +315,8 @@ module.exports.tests.united_kingdom = function(test, common) {
{ label: 'dependency name', role: 'required', layer: 'dependency' },
],
separator: ', ',
}); t.end();
});
t.end();
});

};
12 changes: 8 additions & 4 deletions test/labelGenerator_JPN_JPN.js
Original file line number Diff line number Diff line change
@@ -78,7 +78,8 @@ module.exports.tests.english_style_labels = function(test, common) {
' ',
],
separator: '',
});t.end();
});
t.end();
});

test('Shizuoka (smaller city near Tokyo) example from OA', function(t) {
@@ -115,7 +116,8 @@ module.exports.tests.english_style_labels = function(test, common) {
' ',
],
separator: '',
});t.end();
});
t.end();
});

test('address in Sapporo from OA', function(t) {
@@ -185,7 +187,8 @@ module.exports.tests.english_style_labels = function(test, common) {
' ',
],
separator: '',
});t.end();
});
t.end();
});

test('neighbourhood admin area', function(t) {
@@ -218,7 +221,8 @@ module.exports.tests.english_style_labels = function(test, common) {
' ',
],
separator: '',
});t.end();
});
t.end();
});
};