         +depth-first+ traversal-method [
             "." recursive-directory-files
             current-directory get '[ _ ?head drop ] map
+
+            ! preserve file traversal order, but sort
+            ! alphabetically for cross-platform testing
+            [ [ length ] bi@ < ] monotonic-split
+            [ natural-sort ] map natural-sort concat
         ] with-variable
 
         +breadth-first+ traversal-method [
             "." recursive-directory-files
             current-directory get '[ _ ?head drop ] map
+
+            ! preserve file traversal order, but sort
+            ! alphabetically for cross-platform testing
+            [ [ length ] bi@ = ] monotonic-split
+            [ natural-sort ] map concat
         ] with-variable
-
-        ! Linux doesn't return alphabetic ordering
-        os linux? [
-            [ [ path-components length ] map ] bi@
-        ] when
     ] with-test-directory
 ] unit-test

USING: combinators fry io.directories io.directories.hierarchy
io.directories.search io.files.unique io.pathnames kernel
namespaces sequences sorting splitting strings system
tools.test ;

{ t } [
    [

    [ drop f ] find-up-to-root
] unit-test

[
    {
        "/a"
        "/a/a"
        "/a/a/a"
        "/a/b"
        "/a/b/a"
        "/b"
        "/b/a"
        "/b/a/a"
        "/b/b"
        "/b/b/a"
        "/c"
        "/c/a"
        "/c/a/a"
        "/c/b"
        "/c/b/a"
    }
    {
        "/a"
        "/b"
        "/c"
        "/a/a"
        "/a/b"
        "/b/a"
        "/b/b"
        "/c/a"
        "/c/b"
        "/a/a/a"
        "/a/b/a"
        "/b/a/a"
        "/b/b/a"
        "/c/a/a"
        "/c/b/a"
    }
] [
    [
        "a" make-directory
        "a/a" make-directory
