1 # This file is part of NIT ( http://www.nitlanguage.org ).
3 # Copyright 2019 Louis-Vincent Boudreault <lv.boudreault95@gmail.com>
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
9 # http://www.apache.org/licenses/LICENSE-2.0
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.
17 # This module contains util classes and methods for `test_iter_extras`.
18 import functional_types
21 super Fun2[Int,Int,Int]
29 class MinFn[E
: Comparable]
44 var initial_val
: nullable E
49 if initial_val
!= null then
57 super Fun1[String,String]
61 return x
.to_snake_case
66 super Fun1[String, String]
75 super Fun1[Char, Bool]
93 super Fun1[String, Iterator[Char]]
97 return str
.chars
.iterator
102 super Fun1[Int, Bool]
119 super Fun1[String,Int]
127 super Proc1[Ref[Int]]
139 fun min_int_fn
: MinFn[Int]
141 return new MinFn[Int]
144 fun new_int_arr
(x
: nullable Int): InitArrayFn[Int]
146 return new InitArrayFn[Int](x
)
149 fun snake_case_fn
: SnakeCaseFn
151 return new SnakeCaseFn
154 fun upper_fn
: UpperCaseFn
156 return new UpperCaseFn
159 fun is_letter_fn
: IsLetterFn
161 return new IsLetterFn
164 fun add_one
: AddOneFn
169 fun add_one_proc
: AddOneProc
171 return new AddOneProc
174 fun chars_fn
: CharsFn
179 fun lower_than_fn
(x
: Int): LowerThanFn
181 return new LowerThanFn(x
)
184 fun id_int
: IdFn[Int]
189 fun id_str
: IdFn[String]
191 return new IdFn[String]
194 fun str_len
: StrLenFn