aristanetworks / goarista

Fairly general building blocks used in Arista Go code and open-sourced for the benefit of all.
Apache License 2.0
213 stars 68 forks source link

path: Fix GetLongestPrefix handling of edge case paths #78

Closed d33jiang closed 11 months ago

d33jiang commented 11 months ago

The GetLongestPrefix implementation did not return the expected value when given paths that (1) diverged from map nodes at a non-entry node or that (2) terminated at a non-entry (but existent) node. This change updates GetLongestPrefix to have the expected behaviour and updates the testing to systematically explore test input scenarios.

d33jiang commented 11 months ago

Tagging @msulimov-arista as requested.