mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-30 15:21:12 +00:00
Update test fixtures to not use Nat indices
This commit is contained in:
parent
70a1def63b
commit
7e51dfd526
8 changed files with 62 additions and 62 deletions
|
@ -1014,7 +1014,7 @@ fn list_walk_implements_position() {
|
|||
r"
|
||||
Option a : [Some a, None]
|
||||
|
||||
find : List a, a -> Option Nat where a implements Eq
|
||||
find : List a, a -> Option U64 where a implements Eq
|
||||
find = \list, needle ->
|
||||
findHelp list needle
|
||||
|> .v
|
||||
|
@ -2412,7 +2412,7 @@ fn gen_swap() {
|
|||
app "quicksort" provides [main] to "./platform"
|
||||
|
||||
|
||||
swap : Nat, Nat, List a -> List a
|
||||
swap : U64, U64, List a -> List a
|
||||
swap = \i, j, list ->
|
||||
when Pair (List.get list i) (List.get list j) is
|
||||
Pair (Ok atI) (Ok atJ) ->
|
||||
|
@ -2447,7 +2447,7 @@ fn gen_quicksort() {
|
|||
quicksortHelp list 0 (n - 1)
|
||||
|
||||
|
||||
quicksortHelp : List (Num a), Nat, Nat -> List (Num a)
|
||||
quicksortHelp : List (Num a), U64, U64 -> List (Num a)
|
||||
quicksortHelp = \list, low, high ->
|
||||
if low < high then
|
||||
when partition low high list is
|
||||
|
@ -2459,7 +2459,7 @@ fn gen_quicksort() {
|
|||
list
|
||||
|
||||
|
||||
swap : Nat, Nat, List a -> List a
|
||||
swap : U64, U64, List a -> List a
|
||||
swap = \i, j, list ->
|
||||
when Pair (List.get list i) (List.get list j) is
|
||||
Pair (Ok atI) (Ok atJ) ->
|
||||
|
@ -2470,7 +2470,7 @@ fn gen_quicksort() {
|
|||
_ ->
|
||||
[]
|
||||
|
||||
partition : Nat, Nat, List (Num a) -> [Pair Nat (List (Num a))]
|
||||
partition : U64, U64, List (Num a) -> [Pair U64 (List (Num a))]
|
||||
partition = \low, high, initialList ->
|
||||
when List.get initialList high is
|
||||
Ok pivot ->
|
||||
|
@ -2482,7 +2482,7 @@ fn gen_quicksort() {
|
|||
Pair low initialList
|
||||
|
||||
|
||||
partitionHelp : Nat, Nat, List (Num a), Nat, (Num a) -> [Pair Nat (List (Num a))]
|
||||
partitionHelp : U64, U64, List (Num a), U64, (Num a) -> [Pair U64 (List (Num a))]
|
||||
partitionHelp = \i, j, list, high, pivot ->
|
||||
if j < high then
|
||||
when List.get list j is
|
||||
|
@ -2520,7 +2520,7 @@ fn quicksort() {
|
|||
quicksortHelp list 0 (List.len list - 1)
|
||||
|
||||
|
||||
quicksortHelp : List (Num a), Nat, Nat -> List (Num a)
|
||||
quicksortHelp : List (Num a), U64, U64 -> List (Num a)
|
||||
quicksortHelp = \list, low, high ->
|
||||
if low < high then
|
||||
when partition low high list is
|
||||
|
@ -2532,7 +2532,7 @@ fn quicksort() {
|
|||
list
|
||||
|
||||
|
||||
swap : Nat, Nat, List a -> List a
|
||||
swap : U64, U64, List a -> List a
|
||||
swap = \i, j, list ->
|
||||
when Pair (List.get list i) (List.get list j) is
|
||||
Pair (Ok atI) (Ok atJ) ->
|
||||
|
@ -2543,7 +2543,7 @@ fn quicksort() {
|
|||
_ ->
|
||||
[]
|
||||
|
||||
partition : Nat, Nat, List (Num a) -> [Pair Nat (List (Num a))]
|
||||
partition : U64, U64, List (Num a) -> [Pair U64 (List (Num a))]
|
||||
partition = \low, high, initialList ->
|
||||
when List.get initialList high is
|
||||
Ok pivot ->
|
||||
|
@ -2555,7 +2555,7 @@ fn quicksort() {
|
|||
Pair low initialList
|
||||
|
||||
|
||||
partitionHelp : Nat, Nat, List (Num a), Nat, Num a -> [Pair Nat (List (Num a))]
|
||||
partitionHelp : U64, U64, List (Num a), U64, Num a -> [Pair U64 (List (Num a))]
|
||||
partitionHelp = \i, j, list, high, pivot ->
|
||||
# if j < high then
|
||||
if Bool.false then
|
||||
|
@ -2596,7 +2596,7 @@ fn quicksort_singleton() {
|
|||
quicksortHelp list 0 (List.len list - 1)
|
||||
|
||||
|
||||
quicksortHelp : List (Num a), Nat, Nat -> List (Num a)
|
||||
quicksortHelp : List (Num a), U64, U64 -> List (Num a)
|
||||
quicksortHelp = \list, low, high ->
|
||||
if low < high then
|
||||
when partition low high list is
|
||||
|
@ -2608,7 +2608,7 @@ fn quicksort_singleton() {
|
|||
list
|
||||
|
||||
|
||||
swap : Nat, Nat, List a -> List a
|
||||
swap : U64, U64, List a -> List a
|
||||
swap = \i, j, list ->
|
||||
when Pair (List.get list i) (List.get list j) is
|
||||
Pair (Ok atI) (Ok atJ) ->
|
||||
|
@ -2619,7 +2619,7 @@ fn quicksort_singleton() {
|
|||
_ ->
|
||||
[]
|
||||
|
||||
partition : Nat, Nat, List (Num a) -> [Pair Nat (List (Num a))]
|
||||
partition : U64, U64, List (Num a) -> [Pair U64 (List (Num a))]
|
||||
partition = \low, high, initialList ->
|
||||
when List.get initialList high is
|
||||
Ok pivot ->
|
||||
|
@ -2631,7 +2631,7 @@ fn quicksort_singleton() {
|
|||
Pair low initialList
|
||||
|
||||
|
||||
partitionHelp : Nat, Nat, List (Num a), Nat, Num a -> [Pair Nat (List (Num a))]
|
||||
partitionHelp : U64, U64, List (Num a), U64, Num a -> [Pair U64 (List (Num a))]
|
||||
partitionHelp = \i, j, list, high, pivot ->
|
||||
if j < high then
|
||||
when List.get list j is
|
||||
|
@ -3512,7 +3512,7 @@ fn monomorphized_lists() {
|
|||
r"
|
||||
l = \{} -> [1, 2, 3]
|
||||
|
||||
f : List U8, List U16 -> Nat
|
||||
f : List U8, List U16 -> U64
|
||||
f = \_, _ -> 18
|
||||
|
||||
f (l {}) (l {})
|
||||
|
@ -3753,7 +3753,7 @@ fn list_walk_backwards_implements_position() {
|
|||
r"
|
||||
Option a : [Some a, None]
|
||||
|
||||
find : List a, a -> Option Nat where a implements Eq
|
||||
find : List a, a -> Option U64 where a implements Eq
|
||||
find = \list, needle ->
|
||||
findHelp list needle
|
||||
|> .v
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue