* StringTest.cs: Added test for Concat when one of the arguments is an
[mono.git] / mono / tests / fib.cs
index 3a3dff9974407beeb601cbd36d7d6025b8a6bebd..eca6065a17856af58ad7eaba58f03c53736abd4c 100755 (executable)
@@ -1,3 +1,5 @@
+using System;
+
 public class Fib {
 
        public static int fib (int n) {
@@ -5,9 +7,23 @@ public class Fib {
                        return 1;
                return fib(n-2)+fib(n-1);
        }
-       public static int Main () {
-               if (fib (32) != 3524578)
-                       return 1;
+       public static int Main (string[] args) {
+               int repeat = 1;
+               
+               if (args.Length == 1)
+                       repeat = Convert.ToInt32 (args [0]);
+               
+//             Console.WriteLine ("Repeat = " + repeat);
+
+               if (repeat > 32) {
+                       Console.WriteLine ("{0}", fib (repeat));
+                       return 0;
+               }
+                       
+               for (int i = 0; i < repeat; i++)
+                       if (fib (32) != 3524578)
+                               return 1;
+
                return 0;
        }
 }