diff --git a/apps/transport/test/transport/csv_documents_test.exs b/apps/transport/test/transport/csv_documents_test.exs index 24993ef940..b5c7267ae3 100644 --- a/apps/transport/test/transport/csv_documents_test.exs +++ b/apps/transport/test/transport/csv_documents_test.exs @@ -32,7 +32,8 @@ defmodule Transport.CSVDocumentsTest do # Check `operator` values. Prevent typos and ensure unique values. # Detect things like `Cykleo` VS `Cykléo`. for x <- operators, y <- operators, x != y do - assert String.jaro_distance(x, y) <= 0.75, "#{x} and #{y} look too similar. Is it the same operator?" + error_message = "#{x} and #{y} look too similar. Is it the same operator?" + assert String.jaro_distance(x, y) <= 0.75 || distinct_operators?(x, y), error_message end # Check `url` values. Make sure there is at most a single match per GBFS feed. @@ -43,4 +44,11 @@ defmodule Transport.CSVDocumentsTest do refute String.contains?(x, y), "#{x} is contained #{y}. A GBFS feed can only match for a single URL." end end + + def distinct_operators?(x, y) do + [ + ["Citiz", "Citybike"] + ] + |> Enum.member?(Enum.sort([x, y])) + end end