Merge pull request #5714 from alexischr/update_bockbuild
[mono.git] / mono / tests / bug-459094.cs
1 using System;
2 using System.IO;
3
4 class Driver
5 {
6         static int Main ()
7         {
8                 string step = "abcde12345abcde12345abcde12345abcde12345";
9                 string expected = Directory.GetCurrentDirectory();
10                 string current = "";
11                 /*if (Directory.Exists (step)) FIXME this doesn't work on linux 
12                         Directory.Delete (step, true);*/
13
14                 try {
15                         for (int i = 0; i < 4000; ++i) {
16                                 current = Directory.GetCurrentDirectory ();
17                                 if (!current.Equals (expected)) {
18                                         Console.WriteLine ("expected dir {0} but got {1}", expected, current);
19                                         return 1;
20                                 }
21                                 Console.WriteLine("I={0} DIR={1}",i,Directory.GetCurrentDirectory().Length);
22                                 Directory.CreateDirectory (step);
23                                 Directory.SetCurrentDirectory (step);
24                                 expected += Path.DirectorySeparatorChar + step;
25                         }
26                 } catch (PathTooLongException) {
27                         Console.WriteLine ("ok, got PathTooLongException");
28                         return 0;
29                 }
30
31                 Console.WriteLine ("Max path not reached");
32                 return 2;
33         }
34 }
35