Skip to content

Commit

Permalink
[transit][world_feed_integration_tests] Add backward shape test.
Browse files Browse the repository at this point in the history
  • Loading branch information
tatiana-yan authored and mesozoic-drones committed Mar 18, 2021
1 parent a2e53e2 commit 5a396fa
Showing 1 changed file with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,23 @@ class WorldFeedIntegrationTests
TEST(!m_globalFeed.SetFeed(std::move(feed)), ());
}

void ReadFeedWithBackwardOrder()
{
gtfs::Feed feed(base::JoinPath(m_testPath, "feed_with_backward_order"));
TEST_EQUAL(feed.read_feed().code, gtfs::ResultCode::OK, ());
TEST(m_globalFeed.SetFeed(std::move(feed)), ());

TEST_EQUAL(m_globalFeed.m_networks.m_data.size(), 1, ());
TEST_EQUAL(m_globalFeed.m_routes.m_data.size(), 1, ());
TEST_EQUAL(m_globalFeed.m_lines.m_data.size(), 1, ());
TEST_EQUAL(m_globalFeed.m_stops.m_data.size(), 16, ());
TEST_EQUAL(m_globalFeed.m_shapes.m_data.size(), 1, ());
TEST_EQUAL(m_globalFeed.m_gates.m_data.size(), 0, ());
TEST_EQUAL(m_globalFeed.m_transfers.m_data.size(), 2, ());
TEST_EQUAL(m_globalFeed.m_edges.m_data.size(), 16, ());
TEST_EQUAL(m_globalFeed.m_edgesTransfers.m_data.size(), 2, ());
}

// Test for train itinerary that passes through 4 regions in Europe and consists of 4 stops
// (each in separate mwm) and 1 route with 1 line. This line passes through 4 stops:
// [1] Switzerland_Ticino -> [2] Switzerland_Eastern ->
Expand Down Expand Up @@ -173,4 +190,9 @@ UNIT_CLASS_TEST(WorldFeedIntegrationTests, FeedWithWrongStopsOrder)
{
ReadFeedWithWrongStopsOrder();
}

UNIT_CLASS_TEST(WorldFeedIntegrationTests, FeedWithBackwardOrder)
{
ReadFeedWithBackwardOrder();
}
} // namespace transit

0 comments on commit 5a396fa

Please sign in to comment.