Skip to content
Browse files

Test for Char.IsNumber.

svn path=/trunk/mono/; revision=4222
  • Loading branch information...
1 parent 1ea7f07 commit f1dfe191daa37cf8ff17a01d2cc35b22f27c0852 @illupus illupus committed
Showing with 19 additions and 0 deletions.
  1. +1 −0 mono/tests/Makefile.am
  2. +18 −0 mono/tests/char-isnumber.cs
View
1 mono/tests/Makefile.am
@@ -9,6 +9,7 @@ BENCHSRC=fib.cs random.cs nested-loops.cs ackermann.cs tight-loop.cs sieve.cs
TESTSRC= \
array-init.cs \
arraylist.cs \
+ char-isnumber.cs \
field-layout.cs \
hash-table.cs \
test-ops.cs \
View
18 mono/tests/char-isnumber.cs
@@ -0,0 +1,18 @@
+using System;
+
+class T {
+ static int Main() {
+ char[] chars = new char[]
+ {'0', 'F', 'f', 'x', '1', 'n', 'a'};
+ bool[] results = new bool[]
+ {true, false, false, false, true, false, false};
+
+ for (int i = 0; i < chars.Length; ++i) {
+ if (Char.IsNumber (chars [i]) != results [i]) {
+ Console.WriteLine ("Char '{0}' failed", chars [i]);
+ return 1;
+ }
+ }
+ return 0;
+ }
+}

0 comments on commit f1dfe19

Please sign in to comment.
Something went wrong with that request. Please try again.