@@ -62,8 +62,8 @@ object StatFactorySpec : Spek({
6262 assertThat(stat.path, equalTo("the-test-file"))
6363 }
6464
65- it("returns the mode of the file, with the permission bits set to rwxr-xr-x") {
66- assertThat(stat.mode, equalTo(octal("100755 ")))
65+ it("returns the Golang platform-independent mode of the file, with the permission bits set to rwxr-xr-x") {
66+ assertThat(stat.mode, equalTo(octal("755 ")))
6767 }
6868
6969 it("returns root as the owner of the file") {
@@ -121,8 +121,8 @@ object StatFactorySpec : Spek({
121121 assertThat(stat.path, equalTo("the-test-link"))
122122 }
123123
124- it("returns the mode of the symlink, with the permission bits set to rwxr-xr-x") {
125- assertThat(stat.mode, equalTo(octal("120755 ")))
124+ it("returns the Golang platform-independent mode of the symlink, with the permission bits set to rwxr-xr-x") {
125+ assertThat(stat.mode, equalTo(octal("1000000755 ")))
126126 }
127127
128128 it("returns root as the owner of the file") {
@@ -172,8 +172,8 @@ object StatFactorySpec : Spek({
172172 assertThat(stat.path, equalTo("the-test-directory"))
173173 }
174174
175- it("returns the mode of the directory, with the permission bits set to rwxr-xr-x") {
176- assertThat(stat.mode, equalTo(octal("40755 ")))
175+ it("returns the Golang platform-independent mode of the directory, with the permission bits set to rwxr-xr-x") {
176+ assertThat(stat.mode, equalTo(octal("20000000755 ")))
177177 }
178178
179179 it("returns root as the owner of the file") {
@@ -229,8 +229,8 @@ object StatFactorySpec : Spek({
229229 assertThat(stat.path, equalTo("the-test-directory"))
230230 }
231231
232- it("returns the mode of the symlink, with the permission bits set to rwxr-xr-x") {
233- assertThat(stat.mode, equalTo(octal("120755 ")))
232+ it("returns the Golang platform-independent mode of the symlink, with the permission bits set to rwxr-xr-x") {
233+ assertThat(stat.mode, equalTo(octal("1000000755 ")))
234234 }
235235
236236 it("returns root as the owner of the file") {
@@ -296,8 +296,8 @@ object StatFactorySpec : Spek({
296296 assertThat(stat.path, equalTo("the-test-file"))
297297 }
298298
299- it("returns the mode of the file") {
300- assertThat(stat.mode, equalTo(octal("100751 ")))
299+ it("returns the Golang platform-independent mode of the file") {
300+ assertThat(stat.mode, equalTo(octal("751 ")))
301301 }
302302
303303 it("returns the owner of the file") {
@@ -373,10 +373,10 @@ object StatFactorySpec : Spek({
373373 assertThat(stat.path, equalTo("the-test-link"))
374374 }
375375
376- it("returns the mode of the symlink") {
376+ it("returns the Golang platform-independent mode of the symlink") {
377377 val expectedMode = when (Platform .getNativePlatform().os) {
378- Platform .OS .DARWIN -> octal("120755 ")
379- Platform .OS .LINUX -> octal("120777 ") // Symlinks are always 0777 on Linux
378+ Platform .OS .DARWIN -> octal("1000000755 ")
379+ Platform .OS .LINUX -> octal("1000000777 ") // Symlinks are always 0777 on Linux
380380 else -> throw UnsupportedOperationException ()
381381 }
382382
@@ -443,8 +443,8 @@ object StatFactorySpec : Spek({
443443 assertThat(stat.path, equalTo("the-test-directory"))
444444 }
445445
446- it("returns the mode of the directory") {
447- assertThat(stat.mode, equalTo(octal("40751 ")))
446+ it("returns the Golang platform-independent mode of the directory") {
447+ assertThat(stat.mode, equalTo(octal("20000000751 ")))
448448 }
449449
450450 it("returns the owner of the directory") {
@@ -518,10 +518,10 @@ object StatFactorySpec : Spek({
518518 assertThat(stat.path, equalTo("the-test-directory"))
519519 }
520520
521- it("returns the mode of the symlink") {
521+ it("returns the Golang platform-independent mode of the symlink") {
522522 val expectedMode = when (Platform .getNativePlatform().os) {
523- Platform .OS .DARWIN -> octal("120755 ")
524- Platform .OS .LINUX -> octal("120777 ") // Symlinks are always 0777 on Linux
523+ Platform .OS .DARWIN -> octal("1000000755 ")
524+ Platform .OS .LINUX -> octal("1000000777 ") // Symlinks are always 0777 on Linux
525525 else -> throw UnsupportedOperationException ()
526526 }
527527
@@ -573,7 +573,7 @@ object StatFactorySpec : Spek({
573573 }
574574})
575575
576- private fun octal (value : String ): Int = value.toInt( 8 )
576+ private fun octal (value : String ): Int = value.toUInt( 8 ).toInt( )
577577
578578private fun runCommand (vararg args : String ) {
579579 val process = ProcessBuilder (args.toList())
0 commit comments