<commit_before>@routing @bad
Feature: Handle bad data in a graceful manner
	
	Scenario: Empty dataset
		Given the node map
		 | a | b |

		Given the ways
		 | nodes |
		
		When I route I should get
		 | from | to | route |
		 | a    | b  |       |

	Scenario: Start/end point at the same location
		Given the node map
		 | a | b |
		 | 1 | 2 |

		Given the ways
		 | nodes |
		 | ab    |

		When I route I should get
		 | from | to | route |
		 | a    | a  |       |
		 | b    | b  |       |
		 | 1    | 1  |       |
		 | 2    | 2  |       |

	Scenario: Start/end point far outside data area
		Given the node map
		 |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |    | 1 |
		 | a | b |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |    | 2 |
		 |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |    | 3 |

		Given the ways
		 | nodes |
		 | ab    |

		When I route I should get
		 | from | to | route |
		 | 1    | a  | ab    |
		 | 2    | a  | ab    |
		 | 3    | a  | ab    |
		 | 1    | b  |       |
		 | 2    | b  |       |
		 | 3    | b  |       |
		 | 1    | 2  |       |
		 | 1    | 3  |       |
		 | 2    | 1  |       |
		 | 2    | 3  |       |
		 | 3    | 1  |       |
		 | 3    | 2  |       |

	@poles
	Scenario: No routing close to the north/south pole
	Mercator is undefined close to the poles.
	All nodes and request with lat to close to the pole should therfore be ignored.

		Given the node locations
		 | node | lat | lon |
		 | a    | 89  | 0   |
		 | b    | 87  | 0   |
		 | c    | 82  | 0   |
		 | d    | 80  | 0   |
		 | l    | -80 | 0   |
		 | m    | -82 | 0   |
		 | n    | -87 | 0   |
		 | o    | -89 | 0   |

		And the ways
		 | nodes |
		 | ab    |
		 | bc    |
		 | mn    |
		 | no    |

		When I route I should get
		 | from | to | route |
		 | a    | b  |       |
		 | b    | c  |       |
		 | a    | d  |       |
		 | c    | d  | cd    |
		 | l    | m  | cd    |
		 | o    | l  |       |<commit_msg>adding nodes to make tests work<commit_after>@routing @bad
Feature: Handle bad data in a graceful manner
	
	Scenario: Empty dataset
		Given the node map
		 | a | b |

		Given the ways
		 | nodes |
		
		When I route I should get
		 | from | to | route |
		 | a    | b  |       |

	Scenario: Start/end point at the same location
		Given the node map
		 | a | b |
		 | 1 | 2 |

		Given the ways
		 | nodes |
		 | ab    |

		When I route I should get
		 | from | to | route |
		 | a    | a  |       |
		 | b    | b  |       |
		 | 1    | 1  |       |
		 | 2    | 2  |       |

	Scenario: Start/end point far outside data area
		Given the node map
		 |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |    | 1 |
		 | a | b |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |    | 2 |
		 |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |    | 3 |

		Given the ways
		 | nodes |
		 | ab    |

		When I route I should get
		 | from | to | route |
		 | 1    | a  | ab    |
		 | 2    | a  | ab    |
		 | 3    | a  | ab    |
		 | 1    | b  |       |
		 | 2    | b  |       |
		 | 3    | b  |       |
		 | 1    | 2  |       |
		 | 1    | 3  |       |
		 | 2    | 1  |       |
		 | 2    | 3  |       |
		 | 3    | 1  |       |
		 | 3    | 2  |       |

	@poles
	Scenario: No routing close to the north/south pole
	Mercator is undefined close to the poles.
	All nodes and request with latitude to close to either of the poles should therefore be ignored.

		Given the node locations
		 | node | lat | lon |
		 | a    | 89  | 0   |
		 | b    | 87  | 0   |
		 | c    | 82  | 0   |
		 | d    | 80  | 0   |
		 | e    | 78  | 0   |
		 | k    | -78 | 0   |
		 | l    | -80 | 0   |
		 | m    | -82 | 0   |
		 | n    | -87 | 0   |
		 | o    | -89 | 0   |

		And the ways
		 | nodes |
		 | ab    |
		 | bc    |
		 | cd    |
		 | de    |
		 | kl    |
		 | lm    |
		 | mn    |
		 | no    |

		When I route I should get
		 | from | to | route |
		 | a    | b  |       |
		 | b    | c  |       |
		 | a    | d  |       |
		 | c    | d  | cd    |
		 | l    | m  | lm    |
		 | o    | l  |       |
{'fraction_non_alphanumeric': 0.13436275639548284, 'fraction_numerical': 0.024890527771375893, 'mean_word_length': 0.8436703483432455, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 19, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3668689', 'n_tokens_mistral': 2028, 'n_tokens_neox': 1630, 'n_words': 459}