diff --git a/e2e/non_unique_fan_out/e2e_test.go b/e2e/non_unique_fan_out/e2e_test.go index 88713493..5d9ce0be 100644 --- a/e2e/non_unique_fan_out/e2e_test.go +++ b/e2e/non_unique_fan_out/e2e_test.go @@ -15,10 +15,10 @@ func Test(t *testing.T) { out, err := cmd.CombinedOutput() require.NoError(t, err) - require.Equal( + require.Contains( t, - "main/main.neva:4:10: port 'in:start' is used twice\n", string(out), + "main/main.neva:2:10: port 'in:start' is used twice\n", ) require.Equal(t, 0, cmd.ProcessState.ExitCode()) diff --git a/e2e/non_unique_fan_out/main/main.neva b/e2e/non_unique_fan_out/main/main.neva index 8d12ae4b..302dfb03 100644 --- a/e2e/non_unique_fan_out/main/main.neva +++ b/e2e/non_unique_fan_out/main/main.neva @@ -1,5 +1,3 @@ -import { io } - def Main(start any) (stop any) { [:start, :start] -> :stop } \ No newline at end of file diff --git a/e2e/order_dependend_with_arr_inport/main/main.neva b/e2e/order_dependend_with_arr_inport/main/main.neva index 0646f023..88ba2d57 100644 --- a/e2e/order_dependend_with_arr_inport/main/main.neva +++ b/e2e/order_dependend_with_arr_inport/main/main.neva @@ -1,3 +1,5 @@ +import { fmt } + const l list = [1, 2, 3] def Main(start) (stop) { diff --git a/e2e/print_float/main/main.neva b/e2e/print_float/main/main.neva index 3bc02bf7..79a19906 100644 --- a/e2e/print_float/main/main.neva +++ b/e2e/print_float/main/main.neva @@ -1,3 +1,5 @@ +import { fmt } + const x float = 42 def Main(start) (stop) { diff --git a/e2e/regex_submatch_verbose/main/main.neva b/e2e/regex_submatch_verbose/main/main.neva index 4440e040..5c842aeb 100644 --- a/e2e/regex_submatch_verbose/main/main.neva +++ b/e2e/regex_submatch_verbose/main/main.neva @@ -1,4 +1,4 @@ -import { regexp } +import { regexp, fmt } def Main(start) (stop) { fmt.Println, regexp.Submatch, Panic diff --git a/e2e/run_cli_not_from_module_root/foo/bar/main.neva b/e2e/run_cli_not_from_module_root/foo/bar/main.neva index 82467d99..f649d4f6 100644 --- a/e2e/run_cli_not_from_module_root/foo/bar/main.neva +++ b/e2e/run_cli_not_from_module_root/foo/bar/main.neva @@ -1,3 +1,5 @@ +import { fmt } + def Main(start) (stop) { fmt.Println --- diff --git a/e2e/simple_fan_out/main/main.neva b/e2e/simple_fan_out/main/main.neva index 592ccde1..0e7915a0 100644 --- a/e2e/simple_fan_out/main/main.neva +++ b/e2e/simple_fan_out/main/main.neva @@ -1,4 +1,4 @@ -import { time } +import { time, fmt } def Main(start) (stop) { p1 fmt.Println diff --git a/e2e/slow_iteration_with_for/main/main.neva b/e2e/slow_iteration_with_for/main/main.neva index fe4504ee..8b07efcc 100644 --- a/e2e/slow_iteration_with_for/main/main.neva +++ b/e2e/slow_iteration_with_for/main/main.neva @@ -2,7 +2,7 @@ // https://github.com/nevalang/neva/issues/575 // all elements of the array must be printed befofe program terminate -import { time } +import { time, fmt } const lst list = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] @@ -13,8 +13,8 @@ def Main(start) (stop) { } def Slow(data int) (sig any) { - time.Delay - fmt.Println + time.Delay + fmt.Println --- :data -> delay:data $time.second -> delay:dur diff --git a/e2e/slow_iteration_with_map/main/main.neva b/e2e/slow_iteration_with_map/main/main.neva index 26c6e018..de6660fc 100644 --- a/e2e/slow_iteration_with_map/main/main.neva +++ b/e2e/slow_iteration_with_map/main/main.neva @@ -2,15 +2,15 @@ // https://github.com/nevalang/neva/issues/575 // all elements of the array must be printed befofe program terminate -import { time } +import { time, fmt } const lst list = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] def Main(start) (stop) { ListToStream Map{Slow} - List - fmt.Println + List + fmt.Println> --- :start -> { $lst -> listToStream -> map -> list -> println -> :stop diff --git a/e2e/struct_selector_on_port_addr/main/main.neva b/e2e/struct_selector_on_port_addr/main/main.neva index df5447e8..4348ce42 100644 --- a/e2e/struct_selector_on_port_addr/main/main.neva +++ b/e2e/struct_selector_on_port_addr/main/main.neva @@ -1,8 +1,10 @@ +import { fmt } + def Main(start) (stop) { Foo, fmt.Println --- :start -> foo:sig - foo:msg.a -> println:data + foo:msg -> .a -> println:data println:sig -> :stop } @@ -10,4 +12,4 @@ const s struct { a int } = { a: 42 } def Foo(sig any) (msg struct{a int}) { :sig -> { $s -> :msg } -} \ No newline at end of file +} diff --git a/e2e/struct_selector_verbose/main/main.neva b/e2e/struct_selector_verbose/main/main.neva index e02fc49f..c90d0664 100644 --- a/e2e/struct_selector_verbose/main/main.neva +++ b/e2e/struct_selector_verbose/main/main.neva @@ -1,3 +1,5 @@ +import { fmt } + // Here we learn how to read struct field // by using builtin def with compiler directive. diff --git a/examples/filter_list/e2e_test.go b/examples/filter_list/e2e_test.go index ed5775f2..b18adc9b 100644 --- a/examples/filter_list/e2e_test.go +++ b/examples/filter_list/e2e_test.go @@ -19,7 +19,7 @@ func Test(t *testing.T) { defer os.Chdir(wd) for i := 0; i < 1; i++ { - cmd := exec.Command("neva", "run", "filter_list") + cmd := exec.Command("neva", "run", "-trace", "filter_list") // Set a timeout for the command ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second) diff --git a/examples/filter_list/main.neva b/examples/filter_list/main.neva index a0df934e..e69de29b 100644 --- a/examples/filter_list/main.neva +++ b/examples/filter_list/main.neva @@ -1,15 +0,0 @@ -import { fmt } - -const lst list = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] - -def Main(start) (stop) { - ListToStream, Filter{Even}, For{fmt.Println}, Wait - --- - :start -> { - $lst -> listToStream -> filter -> for -> wait -> :stop - } -} - -def Even(data int) (res bool) { - ((:data % 2) == 0) -> :res -}