Skip to content

Commit

Permalink
Merge pull request #18 from TransitApp/feature/tts-fields
Browse files Browse the repository at this point in the history
Add TTS fields
  • Loading branch information
npaun committed Aug 12, 2019
2 parents 072cc71 + 935818c commit 195f538
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 20 deletions.
3 changes: 3 additions & 0 deletions helpers/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ const keysByTableName = {
'parent_station',
'stop_timezone',
'wheelchair_boarding',
'tts_stop_name'
],
routes: [
'route_id',
Expand All @@ -38,6 +39,8 @@ const keysByTableName = {
'route_color',
'route_text_color',
'route_sort_order',
'tts_route_short_name',
'tts_route_long_name'
],
trips: [
'route_id',
Expand Down
10 changes: 5 additions & 5 deletions tests/samples/1/routes.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
agency_id,route_id,route_short_name,route_long_name,route_type
agency_0,route_0,R0,Route 0,3
agency_0,route_x,RX,"""Route X""",3
agency_0,route_utf8,RÛTF8,route_😎êωn → ∞⠁⠧⠑ ⠼éöÿΚαλημέρα'´`,3
agency_0, route_y, RY,"{""routeLongName"":""""}",3
agency_id,route_id,route_short_name,route_long_name,route_type,tts_route_short_name,tts_route_long_name
agency_0,route_0,R0,Route 0,3,r0,rooouuuteee 0
agency_0,route_x,RX,"""Route X""",3,,
agency_0,route_utf8,RÛTF8,route_😎êωn → ∞⠁⠧⠑ ⠼éöÿΚαλημέρα'´`,3,旱獺屬,
agency_0, route_y, RY,"{""routeLongName"":""""}",3,,
20 changes: 10 additions & 10 deletions tests/test_gtfs_options.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ describe('Tests on GTFS constructor options', () => {

expect(String(routesTxt)).to.equal(
'route_id,agency_id,route_short_name,route_long_name,route_desc,route_type,route_url,route_color,' +
'route_text_color,route_sort_order,temp\r\n' +
'route_0,agency_0,R0,Route 0,,3,,,,,some value\r\n' +
'route_x,agency_0,RX,"""Route X""",,3,,,,,some value\r\n' +
'route_utf8,agency_0,RÛTF8,route_😎êωn → ∞⠁⠧⠑ ⠼éöÿΚαλημέρα\'´`,,3,,,,,some value\r\n' +
'route_y,agency_0,RY,"{""routeLongName"":""""}",,3,,,,,some value'
'route_text_color,route_sort_order,tts_route_short_name,tts_route_long_name,temp\r\n' +
'route_0,agency_0,R0,Route 0,,3,,,,,r0,rooouuuteee 0,some value\r\n' +
'route_x,agency_0,RX,"""Route X""",,3,,,,,,,some value\r\n' +
'route_utf8,agency_0,RÛTF8,route_😎êωn → ∞⠁⠧⠑ ⠼éöÿΚαλημέρα\'´`,,3,,,,,旱獺屬,,some value\r\n' +
'route_y,agency_0,RY,"{""routeLongName"":""""}",,3,,,,,,,some value'
);

fs.remove(outputPath, (removeError) => {
Expand Down Expand Up @@ -92,11 +92,11 @@ describe('Tests on GTFS constructor options', () => {

expect(String(routesTxt)).to.equal(
'route_id,agency_id,route_short_name,route_long_name,route_desc,route_type,route_url,route_color,' +
'route_text_color,route_sort_order,temp\r\n' +
'route_0,agency_0,R0,Route 0,,3,,,,,"{""key"":""value""}"\r\n' +
'route_x,agency_0,RX,"""Route X""",,3,,,,,"{""key"":""value""}"\r\n' +
'route_utf8,agency_0,RÛTF8,route_😎êωn → ∞⠁⠧⠑ ⠼éöÿΚαλημέρα\'´`,,3,,,,,"{""key"":""value""}"\r\n' +
'route_y,agency_0,RY,"{""routeLongName"":""""}",,3,,,,,"{""key"":""value""}"'
'route_text_color,route_sort_order,tts_route_short_name,tts_route_long_name,temp\r\n' +
'route_0,agency_0,R0,Route 0,,3,,,,,r0,rooouuuteee 0,"{""key"":""value""}"\r\n' +
'route_x,agency_0,RX,"""Route X""",,3,,,,,,,"{""key"":""value""}"\r\n' +
'route_utf8,agency_0,RÛTF8,route_😎êωn → ∞⠁⠧⠑ ⠼éöÿΚαλημέρα\'´`,,3,,,,,旱獺屬,,"{""key"":""value""}"\r\n' +
'route_y,agency_0,RY,"{""routeLongName"":""""}",,3,,,,,,,"{""key"":""value""}"'
);

fs.remove(outputPath, (removeError) => {
Expand Down
10 changes: 5 additions & 5 deletions tests/tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ describe('Tests on GTFS', () => {
// Test deepness 1
expect(String(routesTxt)).to.equal(
'route_id,agency_id,route_short_name,route_long_name,route_desc,route_type,route_url,route_color,' +
'route_text_color,route_sort_order,some_extra_route_field\r\n' +
'route_0,agency_0,R0,Route 0,Some new description,3,,,,,some_extra_route_value\r\n' +
'route_x,agency_0,RX,"""Route X""",Some new description,3,,,,,some_extra_route_value\r\n' +
'route_text_color,route_sort_order,tts_route_short_name,tts_route_long_name,some_extra_route_field\r\n' +
'route_0,agency_0,R0,Route 0,Some new description,3,,,,,r0,rooouuuteee 0,some_extra_route_value\r\n' +
'route_x,agency_0,RX,"""Route X""",Some new description,3,,,,,,,some_extra_route_value\r\n' +
'route_utf8,agency_0,RÛTF8,route_😎êωn → ∞⠁⠧⠑ ⠼éöÿΚαλημέρα\'´`,' +
'Some new description,3,,,,,some_extra_route_value\r\n' +
'route_y,agency_0,RY,"{""routeLongName"":""""}",Some new description,3,,,,,some_extra_route_value'
'Some new description,3,,,,,旱獺屬,,some_extra_route_value\r\n' +
'route_y,agency_0,RY,"{""routeLongName"":""""}",Some new description,3,,,,,,,some_extra_route_value'
);

// Test singleton
Expand Down

0 comments on commit 195f538

Please sign in to comment.