mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 22:34:45 +00:00
Progress on updating entire compiler for snake_case
This commit is contained in:
parent
db6cc5a7b1
commit
b56fbd38e1
297 changed files with 8416 additions and 8544 deletions
|
@ -49,7 +49,7 @@ fn single_to_list() {
|
|||
assert_evals_to!(
|
||||
indoc!(
|
||||
r"
|
||||
Set.toList (Set.single 42)
|
||||
Set.to_list (Set.single 42)
|
||||
"
|
||||
),
|
||||
RocList::from_slice(&[42]),
|
||||
|
@ -59,7 +59,7 @@ fn single_to_list() {
|
|||
assert_evals_to!(
|
||||
indoc!(
|
||||
r"
|
||||
Set.toList (Set.single 1)
|
||||
Set.to_list (Set.single 1)
|
||||
"
|
||||
),
|
||||
RocList::from_slice(&[1]),
|
||||
|
@ -77,7 +77,7 @@ fn insert() {
|
|||
|> Set.insert 0
|
||||
|> Set.insert 1
|
||||
|> Set.insert 2
|
||||
|> Set.toList
|
||||
|> Set.to_list
|
||||
"
|
||||
),
|
||||
RocList::from_slice(&[0, 1, 2]),
|
||||
|
@ -96,7 +96,7 @@ fn remove() {
|
|||
|> Set.insert 1
|
||||
|> Set.remove 1
|
||||
|> Set.remove 2
|
||||
|> Set.toList
|
||||
|> Set.to_list
|
||||
"
|
||||
),
|
||||
RocList::from_slice(&[0]),
|
||||
|
@ -111,13 +111,13 @@ fn union() {
|
|||
indoc!(
|
||||
r"
|
||||
set1 : Set.Set I64
|
||||
set1 = Set.fromList [1,2]
|
||||
set1 = Set.from_list [1,2]
|
||||
|
||||
set2 : Set.Set I64
|
||||
set2 = Set.fromList [1,3,4]
|
||||
set2 = Set.from_list [1,3,4]
|
||||
|
||||
Set.union set1 set2
|
||||
|> Set.toList
|
||||
|> Set.to_list
|
||||
"
|
||||
),
|
||||
RocList::from_slice(&[1, 3, 4, 2]),
|
||||
|
@ -132,13 +132,13 @@ fn difference() {
|
|||
indoc!(
|
||||
r"
|
||||
set1 : Set.Set I64
|
||||
set1 = Set.fromList [1,2]
|
||||
set1 = Set.from_list [1,2]
|
||||
|
||||
set2 : Set.Set I64
|
||||
set2 = Set.fromList [1,3,4]
|
||||
set2 = Set.from_list [1,3,4]
|
||||
|
||||
Set.difference set1 set2
|
||||
|> Set.toList
|
||||
|> Set.to_list
|
||||
"
|
||||
),
|
||||
RocList::from_slice(&[2]),
|
||||
|
@ -153,13 +153,13 @@ fn intersection() {
|
|||
indoc!(
|
||||
r"
|
||||
set1 : Set.Set I64
|
||||
set1 = Set.fromList [1,2]
|
||||
set1 = Set.from_list [1,2]
|
||||
|
||||
set2 : Set.Set I64
|
||||
set2 = Set.fromList [1,3,4]
|
||||
set2 = Set.from_list [1,3,4]
|
||||
|
||||
Set.intersection set1 set2
|
||||
|> Set.toList
|
||||
|> Set.to_list
|
||||
"
|
||||
),
|
||||
RocList::from_slice(&[1]),
|
||||
|
@ -173,7 +173,7 @@ fn walk_sum() {
|
|||
assert_evals_to!(
|
||||
indoc!(
|
||||
r"
|
||||
Set.walk (Set.fromList [1,2,3]) 0 (\x, y -> x + y)
|
||||
Set.walk (Set.from_list [1,2,3]) 0 (\x, y -> x + y)
|
||||
"
|
||||
),
|
||||
6,
|
||||
|
@ -187,7 +187,7 @@ fn contains() {
|
|||
assert_evals_to!(
|
||||
indoc!(
|
||||
r"
|
||||
Set.contains (Set.fromList [1,3,4]) 4
|
||||
Set.contains (Set.from_list [1,3,4]) 4
|
||||
"
|
||||
),
|
||||
true,
|
||||
|
@ -197,7 +197,7 @@ fn contains() {
|
|||
assert_evals_to!(
|
||||
indoc!(
|
||||
r"
|
||||
Set.contains (Set.fromList [1,3,4]) 2
|
||||
Set.contains (Set.from_list [1,3,4]) 2
|
||||
"
|
||||
),
|
||||
false,
|
||||
|
@ -212,8 +212,8 @@ fn from_list() {
|
|||
indoc!(
|
||||
r"
|
||||
[1,2,2,3,1,4]
|
||||
|> Set.fromList
|
||||
|> Set.toList
|
||||
|> Set.from_list
|
||||
|> Set.to_list
|
||||
"
|
||||
),
|
||||
RocList::from_slice(&[1, 2, 3, 4]),
|
||||
|
@ -227,8 +227,8 @@ fn from_list() {
|
|||
empty = []
|
||||
|
||||
empty
|
||||
|> Set.fromList
|
||||
|> Set.toList
|
||||
|> Set.from_list
|
||||
|> Set.to_list
|
||||
"
|
||||
),
|
||||
RocList::<i64>::default(),
|
||||
|
@ -244,8 +244,8 @@ fn from_list_void() {
|
|||
indoc!(
|
||||
r"
|
||||
[]
|
||||
|> Set.fromList
|
||||
|> Set.toList
|
||||
|> Set.from_list
|
||||
|> Set.to_list
|
||||
"
|
||||
),
|
||||
RocList::<i64>::default(),
|
||||
|
@ -259,7 +259,7 @@ fn to_list_empty() {
|
|||
assert_evals_to!(
|
||||
indoc!(
|
||||
r"
|
||||
Set.toList (Set.empty {})
|
||||
Set.to_list (Set.empty {})
|
||||
"
|
||||
),
|
||||
RocList::<std::convert::Infallible>::default(),
|
||||
|
@ -277,10 +277,10 @@ fn from_list_result() {
|
|||
x = Ok "foo"
|
||||
|
||||
[x]
|
||||
|> Set.fromList
|
||||
|> Set.toList
|
||||
|> Set.from_list
|
||||
|> Set.to_list
|
||||
|> List.len
|
||||
|> Num.toI64
|
||||
|> Num.to_i64
|
||||
"#
|
||||
),
|
||||
1,
|
||||
|
@ -298,10 +298,10 @@ fn resolve_set_eq_issue_4671() {
|
|||
|
||||
main =
|
||||
s1 : Set U8
|
||||
s1 = Set.fromList [1, 2, 3]
|
||||
s1 = Set.from_list [1, 2, 3]
|
||||
|
||||
s2 : Set U8
|
||||
s2 = Set.fromList [3, 2, 1]
|
||||
s2 = Set.from_list [3, 2, 1]
|
||||
|
||||
s1 == s2
|
||||
"#
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue