Jo Shields a575963da9 Imported Upstream version 3.6.0
Former-commit-id: da6be194a6b1221998fc28233f2503bd61dd9d14
2014-08-13 10:39:27 +01:00

36 lines
927 B
C#

using System;
using System.IO;
class Driver
{
static int Main ()
{
string step = "abcde12345abcde12345abcde12345abcde12345";
string expected = Directory.GetCurrentDirectory();
string current = "";
/*if (Directory.Exists (step)) FIXME this doesn't work on linux
Directory.Delete (step, true);*/
try {
for (int i = 0; i < 4000; ++i) {
current = Directory.GetCurrentDirectory ();
if (!current.Equals (expected)) {
Console.WriteLine ("expected dir {0} but got {1}", expected, current);
return 1;
}
Console.WriteLine("I={0} DIR={1}",i,Directory.GetCurrentDirectory().Length);
Directory.CreateDirectory (step);
Directory.SetCurrentDirectory (step);
expected += Path.DirectorySeparatorChar + step;
}
} catch (PathTooLongException) {
Console.WriteLine ("ok, got PathTooLongException");
return 0;
}
Console.WriteLine ("Max path not reached");
return 2;
}
}