Merge: doc: fixed some typos and other misc. corrections
[nit.git] / tests / test_string_is_numeric.nit
1 # This file is part of NIT ( http://www.nitlanguage.org ).
2 #
3 # Copyright 2004-2008 Jean Privat <jean@pryen.org>
4 #
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
8 #
9 # http://www.apache.org/licenses/LICENSE-2.0
10 #
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
16
17 module test_string_is_numeric
18
19 #False
20 print "d52".is_numeric
21
22 #True
23 print "45".is_numeric
24
25 #True
26 print "45.3".is_numeric
27
28 #False
29 print "45,3".is_numeric
30
31 #False
32 print "1,000.80".is_numeric
33
34 #False
35 print "1,000.45.65".is_numeric
36
37 #False
38 print "6.000,58".is_numeric
39
40 #False
41 print "6.000,58,65".is_numeric
42
43 #False
44 print "6.00.512,32".is_numeric
45
46 #False
47 print "6.000.251,52".is_numeric
48
49 #False
50 print "585,210.52".is_numeric
51
52 #False
53 print "21,52,210.52".is_numeric
54
55 var buf = new FlatBuffer
56
57 buf.append("45.3")
58
59 #True
60 print buf.is_numeric
61
62 buf.append("d")
63
64 #False
65 print buf.is_numeric