Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions e2e/assets/import_error_mo/main.mo
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import X "canister:random";
actor {};

1 change: 1 addition & 0 deletions e2e/assets/import_error_mo/patch.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dfx config canisters/e2e_project/main main.mo
9 changes: 4 additions & 5 deletions e2e/assets/matrix_multiply_mo/matrix.mo
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import A "mo:stdlib/array.mo";
import D "canister:dot_product";
import T "canister:transpose";
import M "secret_import.mo";

type Matrix = [[Int]];

Expand All @@ -10,14 +9,14 @@ actor {
assert (a[0].len() == b.len());
let n = a.len();
let k = b[0].len();
let bt = await T.transpose(b);
let bt = await M.T.transpose(b);
let res : [[var Int]] = A.tabulate<[var Int]>(n, func (_:Nat):[var Int] = A.init<Int>(k, 0));
var i = 0;
while (i < n) {
await D.init(a[i]);
await M.D.init(a[i]);
var j = 0;
while (j < k) {
res[i][j] := await D.dot_product_with(bt[j]);
res[i][j] := await M.D.dot_product_with(bt[j]);
j += 1;
};
i += 1;
Expand Down
6 changes: 6 additions & 0 deletions e2e/assets/matrix_multiply_mo/secret_import.mo
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import T_ "canister:transpose";
import D_ "canister:dot_product";
module {
public let T = T_;
public let D = D_;
};
4 changes: 4 additions & 0 deletions e2e/assets/warning_mo/main.mo
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
func returnsLargeTuple() : (Nat,Nat,Nat,Nat,Nat,Nat,Nat,Nat,Nat,Nat,Nat,Nat,Nat,Nat,Nat,Nat,Nat,Nat,Nat,Nat) = (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20);
func wantsLargeTuple(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20) = ();
wantsLargeTuple(returnsLargeTuple());
actor {};
1 change: 1 addition & 0 deletions e2e/assets/warning_mo/patch.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dfx config canisters/e2e_project/main main.mo
12 changes: 12 additions & 0 deletions e2e/build.bash
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,15 @@ teardown() {
assert_command dfx build
[[ -f canisters/e2e_project/_canister.id ]]
}

@test "build outputs warning" {
install_asset warning_mo
assert_command dfx build
assert_match "warning, this pattern consuming type"
}

@test "build fails on unknown imports" {
install_asset import_error_mo
assert_command_fail dfx build
assert_match "Cannot find canister random"
}
2 changes: 1 addition & 1 deletion src/dfx/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ flate2 = "1.0.11"
futures = "0.1.28"
hex = "0.3.2"
ic-http-agent = { "path" = "../ic_http_agent" }
indicatif = "0.12.0"
indicatif = "0.13.0"
lazy_static = "1.4.0"
libflate = "0.1.27"
mockall = "0.6.0"
Expand Down
Loading