Skip to content

Commit 9cebb84

Browse files
committed
[tests] Entrypoints arn't implicity exported
1 parent 00515ac commit 9cebb84

File tree

4 files changed

+47
-0
lines changed

4 files changed

+47
-0
lines changed

tests/modules/entrypoint_1.build

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# This is free and unencumbered software released into the public domain.
2+
# See ../LICENSE.unlicense
3+
4+
# PLZTEST type compile_failure
5+
6+
[Entrypoint_1]
7+
type = program
8+
modules = [Entrypoint1a, Entrypoint1b]
9+

tests/modules/entrypoint_1.exp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
A compilation error occured and this error is not handled gracefully
2+
by the Plasma compiler. Sorry.
3+
Message: Unknown symbol: T1a.test1a
4+
Context: ../entrypoint_1b.p:14
5+
plzc location: predicate `pre.from_ast.ast_to_pre_expr_2'/7
6+
plzc file: pre.from_ast.m

tests/modules/entrypoint_1a.p

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/*
2+
* vim: ft=plasma
3+
* This is free and unencumbered software released into the public domain.
4+
* See ../LICENSE.unlicense
5+
*/
6+
7+
module Entrypoint1a
8+
9+
// Function is not exported.
10+
entrypoint
11+
func test1a() uses IO -> Int {
12+
print!("Test 1\n")
13+
14+
return 0
15+
}
16+

tests/modules/entrypoint_1b.p

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/*
2+
* vim: ft=plasma
3+
* This is free and unencumbered software released into the public domain.
4+
* See ../LICENSE.unlicense
5+
*/
6+
7+
module Entrypoint1b
8+
9+
import Entrypoint1a as T1a
10+
11+
func test1b() uses IO -> Int {
12+
// Call should fail because although test2a is an entrypoin it is not
13+
// exported.
14+
return T1a.test1a!()
15+
}
16+

0 commit comments

Comments
 (0)