nitlanguage
/
nit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge: tests: Test result update for `curl_http`
[nit.git]
/
tests
/
example_sorter.nit
diff --git
a/tests/example_sorter.nit
b/tests/example_sorter.nit
index
32b661c
..
7f43b63
100644
(file)
--- a/
tests/example_sorter.nit
+++ b/
tests/example_sorter.nit
@@
-16,7
+16,8
@@
class BackIntComparator
class BackIntComparator
- super Comparator[Int]
+ super Comparator
+ redef type COMPARED: Int is fixed
redef fun compare(a: Int, b: Int): Int
do
return b <=> a
redef fun compare(a: Int, b: Int): Int
do
return b <=> a
@@
-26,7
+27,8
@@
class BackIntComparator
end
class DecimalComparator
end
class DecimalComparator
- super Comparator[Int]
+ super Comparator
+ redef type COMPARED: Int is fixed
redef fun compare(a: Int, b: Int): Int
do
return (a%10) <=> (b%10)
redef fun compare(a: Int, b: Int): Int
do
return (a%10) <=> (b%10)
@@
-51,7
+53,7
@@
end
var q = get_an_array(50)
print(q.join(" "))
var q = get_an_array(50)
print(q.join(" "))
-(new DefaultComparator[Int]).sort(q)
+(default_comparator).sort(q)
print(q.join(" "))
(new DecimalComparator).sort(q)
print(q.join(" "))
print(q.join(" "))
(new DecimalComparator).sort(q)
print(q.join(" "))