|
20 | 20 |
|
21 | 21 | it('joins paths correctly', function () { |
22 | 22 | $result = joinPaths('path', 'to', 'file'); |
23 | | - expect($result)->toBe('path/to/file'); |
| 23 | + $expected = 'path'.DIRECTORY_SEPARATOR.'to'.DIRECTORY_SEPARATOR.'file'; |
| 24 | + expect($result)->toBe($expected); |
24 | 25 | }); |
25 | 26 |
|
26 | 27 | it('joins paths correctly with leading slash', function () { |
27 | 28 | $result = joinPaths('/path', 'to', 'file'); |
28 | | - expect($result)->toBe('/path/to/file'); |
| 29 | + $expected = '/path'.DIRECTORY_SEPARATOR.'to'.DIRECTORY_SEPARATOR.'file'; |
| 30 | + expect($result)->toBe($expected); |
29 | 31 | }); |
30 | 32 |
|
31 | 33 | it('joins paths correctly with trailing slash', function () { |
32 | 34 | $result = joinPaths('path', 'to', 'file/'); |
33 | | - expect($result)->toBe('path/to/file'); |
| 35 | + $expected = 'path'.DIRECTORY_SEPARATOR.'to'.DIRECTORY_SEPARATOR.'file'; |
| 36 | + expect($result)->toBe($expected); |
34 | 37 | }); |
35 | 38 |
|
36 | 39 | it('joins paths correctly with empty string', function () { |
37 | 40 | $result = joinPaths('path', '', 'file'); |
38 | | - expect($result)->toBe('path/file'); |
| 41 | + $expected = 'path'.DIRECTORY_SEPARATOR.'file'; |
| 42 | + expect($result)->toBe($expected); |
39 | 43 | }); |
40 | 44 |
|
41 | 45 | it('joins paths correctly with empty string and slashes', function () { |
42 | 46 | $result = joinPaths('path', '', '/file'); |
43 | | - expect($result)->toBe('path/file'); |
| 47 | + $expected = 'path'.DIRECTORY_SEPARATOR.'file'; |
| 48 | + expect($result)->toBe($expected); |
44 | 49 | }); |
45 | 50 |
|
46 | 51 | it('ensures directory creation', function () { |
|
0 commit comments