diff --git a/test_suite/unit_tests/Instrumentation/test_rnav_procedures.cxx b/test_suite/unit_tests/Instrumentation/test_rnav_procedures.cxx
index 593302f84..7ce5ac51b 100644
--- a/test_suite/unit_tests/Instrumentation/test_rnav_procedures.cxx
+++ b/test_suite/unit_tests/Instrumentation/test_rnav_procedures.cxx
@@ -655,3 +655,31 @@ void RNAVProcedureTests::testLEBL_LARP2F()
     FGTestApi::runForTime(180.0);
     CPPUNIT_ASSERT_DOUBLES_EQUAL(199, m_gpsNode->getDoubleValue("wp/leg-true-course-deg"), 0.5);
 }
+
+// This could probably be in a better place but this allows it to access TestDelegate.
+// Also it does relate to procedures as its a bug that only occurs with procedures
+void RNAVProcedureTests::testIndexOf()
+{
+	auto egkk = FGAirport::findByIdent("EGKK");
+    auto sid = egkk->findSIDWithIdent("SAM3P");
+    // procedures not loaded, abandon test
+    if (!sid)
+        return;
+
+    auto rm = globals->get_subsystem<FGRouteMgr>();
+    auto fp = new FlightPlan;
+    
+    auto testDelegate = new TestFPDelegate;
+    testDelegate->thePlan = fp;
+    fp->addDelegate(testDelegate);
+    
+    rm->setFlightPlan(fp);
+    FGTestApi::setUp::populateFPWithNasal(fp, "EGKK", "08R", "EGJJ", "27", "LELNA");
+    
+    fp->setSID(sid);
+	FGPositioned::TypeFilter f{FGPositioned::VOR};
+    auto southamptonVOR = fgpositioned_cast<FGNavRecord>(FGPositioned::findClosestWithIdent("SAM", SGGeod::fromDeg(-1.25, 51.0), &f));
+	auto SAM = fp->legAtIndex(6)->waypoint();
+	CPPUNIT_ASSERT_EQUAL(southamptonVOR->ident(), SAM->ident());
+	CPPUNIT_ASSERT_EQUAL(6, fp->findWayptIndex(southamptonVOR));
+}
\ No newline at end of file
diff --git a/test_suite/unit_tests/Instrumentation/test_rnav_procedures.hxx b/test_suite/unit_tests/Instrumentation/test_rnav_procedures.hxx
index 8b8150652..55b2a7768 100644
--- a/test_suite/unit_tests/Instrumentation/test_rnav_procedures.hxx
+++ b/test_suite/unit_tests/Instrumentation/test_rnav_procedures.hxx
@@ -45,6 +45,7 @@ class RNAVProcedureTests : public CppUnit::TestFixture
     CPPUNIT_TEST(testTransitionsSID);
     CPPUNIT_TEST(testTransitionsSTAR);
     CPPUNIT_TEST(testLEBL_LARP2F);
+	CPPUNIT_TEST(testIndexOf);
 
     CPPUNIT_TEST_SUITE_END();
 
@@ -71,6 +72,7 @@ public:
     void testTransitionsSID();
     void testTransitionsSTAR();
     void testLEBL_LARP2F();
+	void testIndexOf();
 private:
     GPS* m_gps = nullptr;
     SGPropertyNode_ptr m_gpsNode;