Merge "Allow cc_prebuilt version suffix to include svn
"
This commit is contained in:
@@ -105,7 +105,7 @@ func addSuffix(list []string, suffix string) []string {
|
|||||||
return list
|
return list
|
||||||
}
|
}
|
||||||
|
|
||||||
var shlibVersionPattern = regexp.MustCompile("(?:\\.\\d+)+")
|
var shlibVersionPattern = regexp.MustCompile("(?:\\.\\d+(?:svn)?)+")
|
||||||
|
|
||||||
// splitFileExt splits a file name into root, suffix and ext. root stands for the file name without
|
// splitFileExt splits a file name into root, suffix and ext. root stands for the file name without
|
||||||
// the file extension and the version number (e.g. "libexample"). suffix stands for the
|
// the file extension and the version number (e.g. "libexample"). suffix stands for the
|
||||||
|
@@ -35,6 +35,22 @@ func TestSplitFileExt(t *testing.T) {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
t.Run("soname with svn version", func(t *testing.T) {
|
||||||
|
root, suffix, ext := splitFileExt("libtest.so.1svn")
|
||||||
|
expected := "libtest"
|
||||||
|
if root != expected {
|
||||||
|
t.Errorf("root should be %q but got %q", expected, root)
|
||||||
|
}
|
||||||
|
expected = ".so.1svn"
|
||||||
|
if suffix != expected {
|
||||||
|
t.Errorf("suffix should be %q but got %q", expected, suffix)
|
||||||
|
}
|
||||||
|
expected = ".so"
|
||||||
|
if ext != expected {
|
||||||
|
t.Errorf("ext should be %q but got %q", expected, ext)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
t.Run("version numbers in the middle should be ignored", func(t *testing.T) {
|
t.Run("version numbers in the middle should be ignored", func(t *testing.T) {
|
||||||
root, suffix, ext := splitFileExt("libtest.1.0.30.so")
|
root, suffix, ext := splitFileExt("libtest.1.0.30.so")
|
||||||
expected := "libtest.1.0.30"
|
expected := "libtest.1.0.30"
|
||||||
|
Reference in New Issue
Block a user