diff --git a/tests/test_raw_parser.py b/tests/test_raw_parser.py index 9a42bef..db8d45b 100644 --- a/tests/test_raw_parser.py +++ b/tests/test_raw_parser.py @@ -69,6 +69,22 @@ class TestRawFileGetVariable: assert len(result) == mock_rawfile.points +class TestRawFileResolveIndex: + def test_exact_match_returns_index(self, mock_rawfile): + assert mock_rawfile.resolve_index("V(out)") == 1 + assert mock_rawfile.resolve_index("time") == 0 + + def test_case_insensitive(self, mock_rawfile): + assert mock_rawfile.resolve_index("v(out)") == 1 + + def test_partial_does_not_match(self, mock_rawfile): + """Unlike get_variable, resolve_index requires an exact name match.""" + assert mock_rawfile.resolve_index("out") is None + + def test_missing_returns_none(self, mock_rawfile): + assert mock_rawfile.resolve_index("V(nonexistent)") is None + + class TestRawFileRunData: def test_get_run_data_slicing(self, mock_rawfile_stepped): """Extracting a single run produces correct point count."""