@@ -67,6 +67,7 @@ public void PullRequest(string url, int? expectPullRequest)
6767 [ TestCase ( "https://github.com/github/VisualStudio" , null ) ]
6868 [ TestCase ( "https://github.com/github/VisualStudio/blob/master/README.md" , "README.md" ) ]
6969 [ TestCase ( "https://github.com/github/VisualStudio/blob/master/README.md#notices" , "README.md" ) ]
70+ [ TestCase ( "https://github.com/github/VisualStudio/blob/0d264d50c57d701fa62d202f481075a6c6dbdce8/src/Code.cs#L86" , "src/Code.cs" ) ]
7071 public void Path ( string url , string expectPath )
7172 {
7273 var target = new GitHubContextService ( ) ;
@@ -76,12 +77,24 @@ public void Path(string url, string expectPath)
7677 Assert . That ( context . Path , Is . EqualTo ( expectPath ) ) ;
7778 }
7879
80+ // HACK: We're assuming that branches don't contain a '/' (sic)
81+ [ TestCase ( "https://github.com/github/VisualStudio/blob/fixes/branch/buggy.cs" , "branch/buggy.cs" ) ]
82+ public void ProblemPath ( string url , string expectPath )
83+ {
84+ var target = new GitHubContextService ( ) ;
85+
86+ var context = target . FindContextFromUrl ( url ) ;
87+
88+ Assert . That ( context . Path , Is . EqualTo ( expectPath ) ) ;
89+ }
90+
7991 [ TestCase ( "https://github.com" , null ) ]
8092 [ TestCase ( "https://github.com/github" , null ) ]
8193 [ TestCase ( "https://github.com/github/VisualStudio" , null ) ]
8294 [ TestCase ( "https://github.com/github/VisualStudio/blob/master/README.md" , null ) ]
8395 [ TestCase ( "https://github.com/github/VisualStudio/blob/master/README.md#notices" , null ) ]
8496 [ TestCase ( "https://github.com/github/VisualStudio/blob/master/src/GitHub.VisualStudio/GitHubPackage.cs#L38" , 38 ) ]
97+ [ TestCase ( "https://github.com/github/VisualStudio/blob/0d264d50c57d701fa62d202f481075a6c6dbdce8/src/Code.cs#L86" , 86 ) ]
8598 public void Line ( string url , int ? expectLine )
8699 {
87100 var target = new GitHubContextService ( ) ;
0 commit comments