Format comment style voice hints

This commit is contained in:
Norbert Renner 2021-02-25 13:47:26 +01:00
parent e34e6a4cb0
commit ea564006e9
5 changed files with 97 additions and 19 deletions

View file

@ -51,6 +51,14 @@ describe('voice hints', () => {
expect(gpx).toEqual(brouterGpx);
});
test('4-comment', () => {
let brouterGpx = read('4-comment.gpx');
brouterGpx = brouterGpx.replace(/;\s*([-0-9]+.[0-9]+?)0+;/g, (match, p1) => `;${p1.padStart(10)};`); // remove trailing zeros
const gpx = BR.Gpx.format(geoJson, 4);
expect(gpx).toEqual(brouterGpx);
});
test('5-gpsies', () => {
const brouterGpx = read('5-gpsies.gpx');
const gpx = BR.Gpx.format(geoJson, 5);