The tests failed for me on windows due to mismatch of expected and actual value of name-separator char (File.separatorChar).
I've forked jboss-modules and committed a quick fix. The fix assumes the name-separator character we want in our resulting paths is '/'. Maybe that's not what you actually want but this fix was quicker (I just wanted to biuld jboss-as).
If you want to see this quick fix, see my last commit. Ignore the first two - it's a commit and rollback (I was going to preserve the original system File.separatorChar in the resulting paths but then decided to go for a quick fix).