Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaszcz committed Oct 28, 2024
1 parent 7bc65e7 commit da9c11c
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 49 deletions.
88 changes: 51 additions & 37 deletions tests/positive/Format.juvix
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,17 @@ Format;
import Stdlib.Prelude -- Import a module of name:
open -- Bring all names into scope but..
hiding -- Hide some names
{-- like this
,; -- don't want , here
-- Bool either
Bool; true; false; mkShow; module Show};
{
-- like this
,;
-- don't want , here
-- Bool either
Bool;
true;
false;
mkShow;
module Show;
};

-- Lorem ipsum dolor sit amet, consectetur adipiscing elit
terminating
Expand Down Expand Up @@ -274,8 +281,11 @@ module Comments;

open Patterns -- before using
using -- before brace
{-- before first f
f; f};
{
-- before first f
f;
f;
};

type list (A : Type) : Type := cons A (list A);
end;
Expand All @@ -302,19 +312,19 @@ module Traits;
instance
showStringI : Show String :=
mkShow@{
show := id
show := id;
};

instance
showBoolI : Show Bool :=
mkShow@{
show := λ{x := ite x "true" "false"}
show := λ{x := ite x "true" "false"};
};

instance
showNatI : Show Nat :=
mkShow@{
show := natToString
show := natToString;
};

showList {A} : {{Show A}} → List A → String
Expand All @@ -326,7 +336,7 @@ module Traits;
instance
showListI {A} {{Show A}} : Show (List A) :=
mkShow@{
show := showList
show := showList;
};

showMaybe {A} {{Show A}} : Maybe A → String
Expand All @@ -336,7 +346,7 @@ module Traits;
instance
showMaybeI {A} {{Show A}} : Show (Maybe A) :=
mkShow@{
show := showMaybe
show := showMaybe;
};

f {A} {{Show A}} : A → String
Expand All @@ -362,7 +372,7 @@ module OperatorRecord;
+ : A -> A -> A;

syntax operator * multiplicative;
* : A -> A -> A
* : A -> A -> A;
};

open Natural;
Expand All @@ -380,7 +390,7 @@ module RecordFieldPragmas;
{-# inline: false #-}
pfst : A;
{-# inline: false #-}
psnd : B
psnd : B;
};
end;

Expand All @@ -389,38 +399,42 @@ longLongLongArg : Int := 0;
longLongLongListArg : List Int := [];

l1 : List Int :=
[ 1
; 2
; longLongLongArg
; longLongLongArg
; longLongLongArg
; longLongLongArg
; longLongLongArg
; longLongLongArg
[
1;
2;
longLongLongArg;
longLongLongArg;
longLongLongArg;
longLongLongArg;
longLongLongArg;
longLongLongArg;
];

l2 : List Int := [1; 2; 3];

l3 : List (List Int) :=
[ [1; 2; 3]
; longLongLongListArg
; longLongLongListArg
; longLongLongListArg
; longLongLongListArg
; longLongLongListArg
[
[1; 2; 3];
longLongLongListArg;
longLongLongListArg;
longLongLongListArg;
longLongLongListArg;
longLongLongListArg;
];

l4 : List (List Int) :=
[ [1; 2; 3]
; longLongLongListArg
; [ longLongLongArg
; longLongLongArg
; longLongLongArg
; longLongLongArg
; longLongLongArg
; longLongLongArg
]
; longLongLongListArg
[
[1; 2; 3];
longLongLongListArg;
[
longLongLongArg;
longLongLongArg;
longLongLongArg;
longLongLongArg;
longLongLongArg;
longLongLongArg;
];
longLongLongListArg;
];

-- Format as-pattern interacting with implicit args.
Expand Down
14 changes: 7 additions & 7 deletions tests/positive/Puns.juvix
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@ type S :=
fieldB : B;
fieldC : A;
fieldD : B;
fieldE : B
fieldE : B;
};

f (fieldA : A) (fieldB : B) : S :=
let
fieldD := b;
in mkS@{
fieldC := fieldA;
fieldA;
fieldB;
fieldE := b;
fieldD
};
fieldC := fieldA;
fieldA;
fieldB;
fieldE := b;
fieldD;
};
2 changes: 1 addition & 1 deletion tests/positive/RecordIterator.juvix
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ type Foldable (container elem : Type) :=
for : {B : Type} -> (B -> elem -> B) -> B -> container -> B;

syntax iterator rfor {init := 1; range := 1};
rfor : {B : Type} -> (B -> elem -> B) -> B → container → B
rfor : {B : Type} -> (B -> elem -> B) -> B → container → B;
};

open Foldable;
Expand Down
2 changes: 1 addition & 1 deletion tests/positive/issue2999.juvix
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ type T := t;

fun : T :=
namedFun@{
x := t
x := t;
};

namedFun (x : T) : T := t;
7 changes: 4 additions & 3 deletions tests/positive/package/Package.juvix
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ package : Package :=
name := "foo";
version := mkVersion 0 1 0;
dependencies :=
[ github "anoma" "juvix-stdlib" "adf58a7180b361a022fb53c22ad9e5274ebf6f66"
; github "anoma" "juvix-containers" "v0.7.1"
]
[
github "anoma" "juvix-stdlib" "adf58a7180b361a022fb53c22ad9e5274ebf6f66";
github "anoma" "juvix-containers" "v0.7.1";
];
};

0 comments on commit da9c11c

Please sign in to comment.