@@ -55,6 +55,27 @@ local tests = {
5555 {{ [[ C:\a\b]] }, { " C:/a/b" }},
5656 {{ [[ \\srv\share\a]] }, { " //srv/share/a" }},
5757 },
58+ commonprefix = {
59+ " common" ,
60+ {{{ }}, { " " }},
61+ {{{ " " , " abc" }}, { " " }},
62+ {{{ " abc" , " abd" }}, { " ab" }},
63+ {{{ " Xbcd" , " Xb" }}, { " Xb" }},
64+ {{{ " abcX" , " abcd" }}, { " abc" }},
65+ {{{ " aXc" , " aX" }}, { " aX" }},
66+ {{{ " abc" , " abc" }}, { " abc" }},
67+ {{{ " abc" , " xbc" }}, { " " }},
68+ {{{ " /a/b" , " /a/c" }}, { " /a/" }},
69+ {{{ " /home/swenson/spam" , " /home/swen/spam" }}, { " /home/swen" }},
70+ {{{ " /home/swen/spam" , " /home/swen/eggs" }}, { " /home/swen/" }},
71+ {{{ " /home/swen/spam" , " /home/swen/spam" }}, { " /home/swen/spam" }},
72+ {{{ " home:swenson:spam" , " home:swen:spam" }}, { " home:swen" }},
73+ {{{ " :home:swen:spam" , " :home:swen:eggs" }}, { " :home:swen:" }},
74+ {{{ " :home:swen:spam" , " :home:swen:spam" }}, { " :home:swen:spam" }},
75+ {{{ " /home/swen/spam" , " /home/swen/spam" }}, { " /home/swen/spam" }},
76+ " windows" ,
77+ {{{ [[ \home\swen\spam]] , [[ \home\swen\eggs]] }}, { [[ \home\swen\]] }},
78+ },
5879 dirnames = {
5980 " posix" ,
6081 {{ " a/b/c" }, {{ " a/b" , " a" , " ." }}},
0 commit comments