From eb0863cda9757b425f8c5666cc82e89bbc1f430c Mon Sep 17 00:00:00 2001 From: damirka Date: Wed, 4 Aug 2021 23:34:11 +0300 Subject: [PATCH] closes #1183 --- compiler/src/test.rs | 19 ++++++++--------- .../imports/dependency/inputs/dependency.in | 3 +++ .../imports/dependency/src/main.leo | 9 ++++++++ .../compiler/import_dependency/input/dummy.in | 6 ++++++ tests/compiler/import_dependency/readme.md | 8 +++++++ .../tests/import_dependency_folder.leo | 12 +++++++++++ tests/compiler/import_local/import_all.leo | 14 +++++++++++++ tests/compiler/import_local/import_as.leo | 12 +++++++++++ tests/compiler/import_local/import_dir.leo | 12 +++++++++++ tests/compiler/import_local/import_files.leo | 12 +++++++++++ tests/compiler/import_local/import_many.leo | 17 +++++++++++++++ .../import_local/import_weird_names.leo | 12 +++++++++++ tests/compiler/import_local/input/dummy.in | 6 ++++++ .../import_local/local_imports/a-9.leo | 0 .../import_local/local_imports/circuits.leo | 8 +++++++ .../import_local/local_imports/lib.leo | 3 +++ .../local_imports/nested/hello.leo | 3 +++ .../compiler/{import => import_old}/alias.leo | 0 .../compiler/{import => import_old}/basic.leo | 0 .../{import => import_old}/imports/a-9.leo | 0 .../{import => import_old}/imports/a0-f.leo | 0 .../imports/bar/.gitignore | 0 .../imports/bar/Leo.toml | 0 .../imports/bar/src/bat/bat.leo | 0 .../imports/bar/src/baz.leo | 0 .../imports/bar/src/lib.leo | 0 .../imports/car/.gitignore | 0 .../imports/car/Leo.toml | 0 .../imports/car/src/lib.leo | 0 .../imports/hello-world.leo | 0 .../{import => import_old}/imports/lib.leo | 0 .../imports/test-import.leo | 0 .../{import => import_old}/input/dummy.in | 0 .../{import => import_old}/many_import.leo | 0 .../many_import_star.leo | 0 .../{import => import_old}/multiple.leo | 0 .../compiler/{import => import_old}/names.leo | 0 .../names_a_dash_fail.leo | 0 .../names_dash_a_fail.leo | 0 .../names_dollar_fail.leo | 0 .../names_underscore_fail.leo | 0 .../compiler/{import => import_old}/star.leo | 0 .../{import => import_old}/star_fail.leo | 0 .../{import => import_old}/string_import.leo | 0 .../tests/import_dependency_folder.leo.out | 21 +++++++++++++++++++ .../compiler/import_local/import_all.leo.out | 21 +++++++++++++++++++ .../compiler/import_local/import_as.leo.out | 21 +++++++++++++++++++ .../compiler/import_local/import_dir.leo.out | 21 +++++++++++++++++++ .../import_local/import_files.leo.out | 21 +++++++++++++++++++ .../compiler/import_local/import_many.leo.out | 21 +++++++++++++++++++ .../import_local/import_weird_names.leo.out | 21 +++++++++++++++++++ 51 files changed, 293 insertions(+), 10 deletions(-) create mode 100644 tests/compiler/import_dependency/imports/dependency/inputs/dependency.in create mode 100644 tests/compiler/import_dependency/imports/dependency/src/main.leo create mode 100644 tests/compiler/import_dependency/input/dummy.in create mode 100644 tests/compiler/import_dependency/readme.md create mode 100644 tests/compiler/import_dependency/tests/import_dependency_folder.leo create mode 100644 tests/compiler/import_local/import_all.leo create mode 100644 tests/compiler/import_local/import_as.leo create mode 100644 tests/compiler/import_local/import_dir.leo create mode 100644 tests/compiler/import_local/import_files.leo create mode 100644 tests/compiler/import_local/import_many.leo create mode 100644 tests/compiler/import_local/import_weird_names.leo create mode 100644 tests/compiler/import_local/input/dummy.in create mode 100644 tests/compiler/import_local/local_imports/a-9.leo create mode 100644 tests/compiler/import_local/local_imports/circuits.leo create mode 100644 tests/compiler/import_local/local_imports/lib.leo create mode 100644 tests/compiler/import_local/local_imports/nested/hello.leo rename tests/compiler/{import => import_old}/alias.leo (100%) rename tests/compiler/{import => import_old}/basic.leo (100%) rename tests/compiler/{import => import_old}/imports/a-9.leo (100%) rename tests/compiler/{import => import_old}/imports/a0-f.leo (100%) rename tests/compiler/{import => import_old}/imports/bar/.gitignore (100%) rename tests/compiler/{import => import_old}/imports/bar/Leo.toml (100%) rename tests/compiler/{import => import_old}/imports/bar/src/bat/bat.leo (100%) rename tests/compiler/{import => import_old}/imports/bar/src/baz.leo (100%) rename tests/compiler/{import => import_old}/imports/bar/src/lib.leo (100%) rename tests/compiler/{import => import_old}/imports/car/.gitignore (100%) rename tests/compiler/{import => import_old}/imports/car/Leo.toml (100%) rename tests/compiler/{import => import_old}/imports/car/src/lib.leo (100%) rename tests/compiler/{import => import_old}/imports/hello-world.leo (100%) rename tests/compiler/{import => import_old}/imports/lib.leo (100%) rename tests/compiler/{import => import_old}/imports/test-import.leo (100%) rename tests/compiler/{import => import_old}/input/dummy.in (100%) rename tests/compiler/{import => import_old}/many_import.leo (100%) rename tests/compiler/{import => import_old}/many_import_star.leo (100%) rename tests/compiler/{import => import_old}/multiple.leo (100%) rename tests/compiler/{import => import_old}/names.leo (100%) rename tests/compiler/{import => import_old}/names_a_dash_fail.leo (100%) rename tests/compiler/{import => import_old}/names_dash_a_fail.leo (100%) rename tests/compiler/{import => import_old}/names_dollar_fail.leo (100%) rename tests/compiler/{import => import_old}/names_underscore_fail.leo (100%) rename tests/compiler/{import => import_old}/star.leo (100%) rename tests/compiler/{import => import_old}/star_fail.leo (100%) rename tests/compiler/{import => import_old}/string_import.leo (100%) create mode 100644 tests/expectations/compiler/compiler/import_dependency/tests/import_dependency_folder.leo.out create mode 100644 tests/expectations/compiler/compiler/import_local/import_all.leo.out create mode 100644 tests/expectations/compiler/compiler/import_local/import_as.leo.out create mode 100644 tests/expectations/compiler/compiler/import_local/import_dir.leo.out create mode 100644 tests/expectations/compiler/compiler/import_local/import_files.leo.out create mode 100644 tests/expectations/compiler/compiler/import_local/import_many.leo.out create mode 100644 tests/expectations/compiler/compiler/import_local/import_weird_names.leo.out diff --git a/compiler/src/test.rs b/compiler/src/test.rs index 728ee65d4f..d7ccbdedb5 100644 --- a/compiler/src/test.rs +++ b/compiler/src/test.rs @@ -66,8 +66,9 @@ fn hash(input: String) -> String { pub(crate) fn parse_program( program_string: &str, theorem_options: Option, + cwd: Option, ) -> Result { - let mut compiler = new_compiler("compiler-test".into(), theorem_options); + let mut compiler = new_compiler(cwd.unwrap_or("compiler-test".into()), theorem_options); compiler.parse_program_from_string(program_string)?; @@ -101,15 +102,12 @@ impl Namespace for CompileNamespace { // ``` cwd: import ``` // When set, uses different working directory for current file. // If not, uses file path as current working directory. - // let cwd = test - // .config - // .get("cwd") - // .map(|val| { - // let mut cwd = test.path.clone(); - // cwd.pop(); - // cwd.join(&val.as_str().unwrap()) - // }) - // .unwrap_or(test.path.clone()); + let cwd = test.config.get("cwd").map(|val| { + let mut cwd = test.path.clone(); + cwd.pop(); + cwd.join(&val.as_str().unwrap()) + }); + // .unwrap_or(test.path.clone()); let parsed = parse_program( &test.content, @@ -118,6 +116,7 @@ impl Namespace for CompileNamespace { canonicalized: true, type_inferenced: true, }), + cwd, ) .map_err(|x| x.to_string())?; diff --git a/tests/compiler/import_dependency/imports/dependency/inputs/dependency.in b/tests/compiler/import_dependency/imports/dependency/inputs/dependency.in new file mode 100644 index 0000000000..03eacdd3ad --- /dev/null +++ b/tests/compiler/import_dependency/imports/dependency/inputs/dependency.in @@ -0,0 +1,3 @@ +[main] + +[registers] diff --git a/tests/compiler/import_dependency/imports/dependency/src/main.leo b/tests/compiler/import_dependency/imports/dependency/src/main.leo new file mode 100644 index 0000000000..1516361c71 --- /dev/null +++ b/tests/compiler/import_dependency/imports/dependency/src/main.leo @@ -0,0 +1,9 @@ +circuit Cave { + function name() -> [char; 4] { + return "cave"; + } +} + +function main() { + +} diff --git a/tests/compiler/import_dependency/input/dummy.in b/tests/compiler/import_dependency/input/dummy.in new file mode 100644 index 0000000000..5686421617 --- /dev/null +++ b/tests/compiler/import_dependency/input/dummy.in @@ -0,0 +1,6 @@ +[main] +y: bool = true; +n: bool = false; + +[registers] +r0: bool = true; diff --git a/tests/compiler/import_dependency/readme.md b/tests/compiler/import_dependency/readme.md new file mode 100644 index 0000000000..276f8fe3e9 --- /dev/null +++ b/tests/compiler/import_dependency/readme.md @@ -0,0 +1,8 @@ +Tests in this folder test external dependencies that were imported. To mock that we +need to have structure similar to typical Leo package: source files must be in the +directory next to `imports/`; but instead of `src/` we have `tests/` here. + +Option `cwd` param in these tests must point to the `tests/`, so having it as `.` +should be enough. + +Have fun testing! diff --git a/tests/compiler/import_dependency/tests/import_dependency_folder.leo b/tests/compiler/import_dependency/tests/import_dependency_folder.leo new file mode 100644 index 0000000000..2b67b4af14 --- /dev/null +++ b/tests/compiler/import_dependency/tests/import_dependency_folder.leo @@ -0,0 +1,12 @@ +/* +namespace: Compile +expectation: Pass +input_file: ../input/dummy.in +cwd: . +*/ + +import dependency.*; + +function main(y: bool) -> bool { + return y == (Cave::name() == "cave"); +} diff --git a/tests/compiler/import_local/import_all.leo b/tests/compiler/import_local/import_all.leo new file mode 100644 index 0000000000..4ede4f3f38 --- /dev/null +++ b/tests/compiler/import_local/import_all.leo @@ -0,0 +1,14 @@ +/* +namespace: Compile +expectation: Pass +input_file: input/dummy.in +cwd: local_imports +*/ + +import circuits.*; + +function main(y: bool) -> bool { + const a = Point { x: 1u32, y: 0u32 }; + + return (foo() == 1u32) == y; +} diff --git a/tests/compiler/import_local/import_as.leo b/tests/compiler/import_local/import_as.leo new file mode 100644 index 0000000000..36629594f9 --- /dev/null +++ b/tests/compiler/import_local/import_as.leo @@ -0,0 +1,12 @@ +/* +namespace: Compile +expectation: Pass +input_file: input/dummy.in +cwd: local_imports +*/ + +import lib.say_hello as howdy; + +function main(y: bool) -> bool { + return y == (howdy() == "hello"); +} diff --git a/tests/compiler/import_local/import_dir.leo b/tests/compiler/import_local/import_dir.leo new file mode 100644 index 0000000000..229b4a90e9 --- /dev/null +++ b/tests/compiler/import_local/import_dir.leo @@ -0,0 +1,12 @@ +/* +namespace: Compile +expectation: Pass +input_file: input/dummy.in +cwd: local_imports +*/ + +import nested.hello.say_hello; + +function main(y: bool) -> bool { + return y == (say_hello() == "hello"); +} diff --git a/tests/compiler/import_local/import_files.leo b/tests/compiler/import_local/import_files.leo new file mode 100644 index 0000000000..05c1b68a97 --- /dev/null +++ b/tests/compiler/import_local/import_files.leo @@ -0,0 +1,12 @@ +/* +namespace: Compile +expectation: Pass +input_file: input/dummy.in +cwd: local_imports +*/ + +import lib.say_hello; + +function main(y: bool) -> bool { + return y == (say_hello() == "hello"); +} diff --git a/tests/compiler/import_local/import_many.leo b/tests/compiler/import_local/import_many.leo new file mode 100644 index 0000000000..139deea8d2 --- /dev/null +++ b/tests/compiler/import_local/import_many.leo @@ -0,0 +1,17 @@ +/* +namespace: Compile +expectation: Pass +input_file: input/dummy.in +cwd: local_imports +*/ + +import circuits.( + Point, + foo +); + +function main(y: bool) -> bool { + const a = Point { x: 1u32, y: 0u32 }; + + return (foo() == 1u32) == y; +} diff --git a/tests/compiler/import_local/import_weird_names.leo b/tests/compiler/import_local/import_weird_names.leo new file mode 100644 index 0000000000..2a2e169d7f --- /dev/null +++ b/tests/compiler/import_local/import_weird_names.leo @@ -0,0 +1,12 @@ +/* +namespace: Compile +expectation: Pass +input_file: input/dummy.in +cwd: local_imports +*/ + +import a-9.*; + +function main(y: bool) -> bool { + return y == true; +} diff --git a/tests/compiler/import_local/input/dummy.in b/tests/compiler/import_local/input/dummy.in new file mode 100644 index 0000000000..5686421617 --- /dev/null +++ b/tests/compiler/import_local/input/dummy.in @@ -0,0 +1,6 @@ +[main] +y: bool = true; +n: bool = false; + +[registers] +r0: bool = true; diff --git a/tests/compiler/import_local/local_imports/a-9.leo b/tests/compiler/import_local/local_imports/a-9.leo new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/compiler/import_local/local_imports/circuits.leo b/tests/compiler/import_local/local_imports/circuits.leo new file mode 100644 index 0000000000..f24226a9fd --- /dev/null +++ b/tests/compiler/import_local/local_imports/circuits.leo @@ -0,0 +1,8 @@ +circuit Point { + x: u32 + y: u32 +} + +function foo() -> u32 { + return 1u32; +} diff --git a/tests/compiler/import_local/local_imports/lib.leo b/tests/compiler/import_local/local_imports/lib.leo new file mode 100644 index 0000000000..a32e24032a --- /dev/null +++ b/tests/compiler/import_local/local_imports/lib.leo @@ -0,0 +1,3 @@ +function say_hello() -> [char; 5] { + return "hello"; +} diff --git a/tests/compiler/import_local/local_imports/nested/hello.leo b/tests/compiler/import_local/local_imports/nested/hello.leo new file mode 100644 index 0000000000..a32e24032a --- /dev/null +++ b/tests/compiler/import_local/local_imports/nested/hello.leo @@ -0,0 +1,3 @@ +function say_hello() -> [char; 5] { + return "hello"; +} diff --git a/tests/compiler/import/alias.leo b/tests/compiler/import_old/alias.leo similarity index 100% rename from tests/compiler/import/alias.leo rename to tests/compiler/import_old/alias.leo diff --git a/tests/compiler/import/basic.leo b/tests/compiler/import_old/basic.leo similarity index 100% rename from tests/compiler/import/basic.leo rename to tests/compiler/import_old/basic.leo diff --git a/tests/compiler/import/imports/a-9.leo b/tests/compiler/import_old/imports/a-9.leo similarity index 100% rename from tests/compiler/import/imports/a-9.leo rename to tests/compiler/import_old/imports/a-9.leo diff --git a/tests/compiler/import/imports/a0-f.leo b/tests/compiler/import_old/imports/a0-f.leo similarity index 100% rename from tests/compiler/import/imports/a0-f.leo rename to tests/compiler/import_old/imports/a0-f.leo diff --git a/tests/compiler/import/imports/bar/.gitignore b/tests/compiler/import_old/imports/bar/.gitignore similarity index 100% rename from tests/compiler/import/imports/bar/.gitignore rename to tests/compiler/import_old/imports/bar/.gitignore diff --git a/tests/compiler/import/imports/bar/Leo.toml b/tests/compiler/import_old/imports/bar/Leo.toml similarity index 100% rename from tests/compiler/import/imports/bar/Leo.toml rename to tests/compiler/import_old/imports/bar/Leo.toml diff --git a/tests/compiler/import/imports/bar/src/bat/bat.leo b/tests/compiler/import_old/imports/bar/src/bat/bat.leo similarity index 100% rename from tests/compiler/import/imports/bar/src/bat/bat.leo rename to tests/compiler/import_old/imports/bar/src/bat/bat.leo diff --git a/tests/compiler/import/imports/bar/src/baz.leo b/tests/compiler/import_old/imports/bar/src/baz.leo similarity index 100% rename from tests/compiler/import/imports/bar/src/baz.leo rename to tests/compiler/import_old/imports/bar/src/baz.leo diff --git a/tests/compiler/import/imports/bar/src/lib.leo b/tests/compiler/import_old/imports/bar/src/lib.leo similarity index 100% rename from tests/compiler/import/imports/bar/src/lib.leo rename to tests/compiler/import_old/imports/bar/src/lib.leo diff --git a/tests/compiler/import/imports/car/.gitignore b/tests/compiler/import_old/imports/car/.gitignore similarity index 100% rename from tests/compiler/import/imports/car/.gitignore rename to tests/compiler/import_old/imports/car/.gitignore diff --git a/tests/compiler/import/imports/car/Leo.toml b/tests/compiler/import_old/imports/car/Leo.toml similarity index 100% rename from tests/compiler/import/imports/car/Leo.toml rename to tests/compiler/import_old/imports/car/Leo.toml diff --git a/tests/compiler/import/imports/car/src/lib.leo b/tests/compiler/import_old/imports/car/src/lib.leo similarity index 100% rename from tests/compiler/import/imports/car/src/lib.leo rename to tests/compiler/import_old/imports/car/src/lib.leo diff --git a/tests/compiler/import/imports/hello-world.leo b/tests/compiler/import_old/imports/hello-world.leo similarity index 100% rename from tests/compiler/import/imports/hello-world.leo rename to tests/compiler/import_old/imports/hello-world.leo diff --git a/tests/compiler/import/imports/lib.leo b/tests/compiler/import_old/imports/lib.leo similarity index 100% rename from tests/compiler/import/imports/lib.leo rename to tests/compiler/import_old/imports/lib.leo diff --git a/tests/compiler/import/imports/test-import.leo b/tests/compiler/import_old/imports/test-import.leo similarity index 100% rename from tests/compiler/import/imports/test-import.leo rename to tests/compiler/import_old/imports/test-import.leo diff --git a/tests/compiler/import/input/dummy.in b/tests/compiler/import_old/input/dummy.in similarity index 100% rename from tests/compiler/import/input/dummy.in rename to tests/compiler/import_old/input/dummy.in diff --git a/tests/compiler/import/many_import.leo b/tests/compiler/import_old/many_import.leo similarity index 100% rename from tests/compiler/import/many_import.leo rename to tests/compiler/import_old/many_import.leo diff --git a/tests/compiler/import/many_import_star.leo b/tests/compiler/import_old/many_import_star.leo similarity index 100% rename from tests/compiler/import/many_import_star.leo rename to tests/compiler/import_old/many_import_star.leo diff --git a/tests/compiler/import/multiple.leo b/tests/compiler/import_old/multiple.leo similarity index 100% rename from tests/compiler/import/multiple.leo rename to tests/compiler/import_old/multiple.leo diff --git a/tests/compiler/import/names.leo b/tests/compiler/import_old/names.leo similarity index 100% rename from tests/compiler/import/names.leo rename to tests/compiler/import_old/names.leo diff --git a/tests/compiler/import/names_a_dash_fail.leo b/tests/compiler/import_old/names_a_dash_fail.leo similarity index 100% rename from tests/compiler/import/names_a_dash_fail.leo rename to tests/compiler/import_old/names_a_dash_fail.leo diff --git a/tests/compiler/import/names_dash_a_fail.leo b/tests/compiler/import_old/names_dash_a_fail.leo similarity index 100% rename from tests/compiler/import/names_dash_a_fail.leo rename to tests/compiler/import_old/names_dash_a_fail.leo diff --git a/tests/compiler/import/names_dollar_fail.leo b/tests/compiler/import_old/names_dollar_fail.leo similarity index 100% rename from tests/compiler/import/names_dollar_fail.leo rename to tests/compiler/import_old/names_dollar_fail.leo diff --git a/tests/compiler/import/names_underscore_fail.leo b/tests/compiler/import_old/names_underscore_fail.leo similarity index 100% rename from tests/compiler/import/names_underscore_fail.leo rename to tests/compiler/import_old/names_underscore_fail.leo diff --git a/tests/compiler/import/star.leo b/tests/compiler/import_old/star.leo similarity index 100% rename from tests/compiler/import/star.leo rename to tests/compiler/import_old/star.leo diff --git a/tests/compiler/import/star_fail.leo b/tests/compiler/import_old/star_fail.leo similarity index 100% rename from tests/compiler/import/star_fail.leo rename to tests/compiler/import_old/star_fail.leo diff --git a/tests/compiler/import/string_import.leo b/tests/compiler/import_old/string_import.leo similarity index 100% rename from tests/compiler/import/string_import.leo rename to tests/compiler/import_old/string_import.leo diff --git a/tests/expectations/compiler/compiler/import_dependency/tests/import_dependency_folder.leo.out b/tests/expectations/compiler/compiler/import_dependency/tests/import_dependency_folder.leo.out new file mode 100644 index 0000000000..1eeff43f07 --- /dev/null +++ b/tests/expectations/compiler/compiler/import_dependency/tests/import_dependency_folder.leo.out @@ -0,0 +1,21 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - circuit: + num_public_variables: 0 + num_private_variables: 1 + num_constraints: 1 + at: 042610d0fd1fe6d6ac112138f8755752f44c7d2a00f1b5960574d6da5cda393f + bt: e97756698880ab7555a959a5fb5c6b4e15bd64612aa677adbfe2d0bd91f0a83c + ct: cf1cbb66a638b4860a516671fb74850e6ccf787fe6c4c8d29e9c04efe880bd05 + output: + - input_file: "../input/dummy.in" + output: + registers: + r0: + type: bool + value: "true" + initial_ast: d6273a716c2546b210eeefb640b5c34830fb2b2a4195ae0b636843e855fcbc1e + canonicalized_ast: 41a3c4ffe7c243ffc76bc7d3c147f77f71119d64e632581a20eb1cd576752ac3 + type_inferenced_ast: 196e5191c3d8c8cc552b419422b3e1411fa576336f63ae9d5c340bf2a7d62942 diff --git a/tests/expectations/compiler/compiler/import_local/import_all.leo.out b/tests/expectations/compiler/compiler/import_local/import_all.leo.out new file mode 100644 index 0000000000..af0f7a88be --- /dev/null +++ b/tests/expectations/compiler/compiler/import_local/import_all.leo.out @@ -0,0 +1,21 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - circuit: + num_public_variables: 0 + num_private_variables: 1 + num_constraints: 1 + at: 042610d0fd1fe6d6ac112138f8755752f44c7d2a00f1b5960574d6da5cda393f + bt: e97756698880ab7555a959a5fb5c6b4e15bd64612aa677adbfe2d0bd91f0a83c + ct: cf1cbb66a638b4860a516671fb74850e6ccf787fe6c4c8d29e9c04efe880bd05 + output: + - input_file: input/dummy.in + output: + registers: + r0: + type: bool + value: "true" + initial_ast: 1a78fdc95fad861e53d1b0463228701df726fa0bf5092bd94d1d35f57c8c2a94 + canonicalized_ast: 1a78fdc95fad861e53d1b0463228701df726fa0bf5092bd94d1d35f57c8c2a94 + type_inferenced_ast: be1c8166ce3ae7f805d8600441996328ce8f45ada3c16c4284f07d07af52ef75 diff --git a/tests/expectations/compiler/compiler/import_local/import_as.leo.out b/tests/expectations/compiler/compiler/import_local/import_as.leo.out new file mode 100644 index 0000000000..bc897c1c3f --- /dev/null +++ b/tests/expectations/compiler/compiler/import_local/import_as.leo.out @@ -0,0 +1,21 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - circuit: + num_public_variables: 0 + num_private_variables: 1 + num_constraints: 1 + at: 042610d0fd1fe6d6ac112138f8755752f44c7d2a00f1b5960574d6da5cda393f + bt: e97756698880ab7555a959a5fb5c6b4e15bd64612aa677adbfe2d0bd91f0a83c + ct: cf1cbb66a638b4860a516671fb74850e6ccf787fe6c4c8d29e9c04efe880bd05 + output: + - input_file: input/dummy.in + output: + registers: + r0: + type: bool + value: "true" + initial_ast: 47ef8cd0b57a42612bc9138c6da6e05fbca27c47464acf5af569c2fe0c91dd31 + canonicalized_ast: 39c0b27ba63cc34eed735900912e154031ca1f291aade9d9964ce49e77eeb19e + type_inferenced_ast: 19bfc761f899b48a3e0c4142bac6cbdaceac8230e92422cf9f6a99d9f7eddc6f diff --git a/tests/expectations/compiler/compiler/import_local/import_dir.leo.out b/tests/expectations/compiler/compiler/import_local/import_dir.leo.out new file mode 100644 index 0000000000..ebbd5184aa --- /dev/null +++ b/tests/expectations/compiler/compiler/import_local/import_dir.leo.out @@ -0,0 +1,21 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - circuit: + num_public_variables: 0 + num_private_variables: 1 + num_constraints: 1 + at: 042610d0fd1fe6d6ac112138f8755752f44c7d2a00f1b5960574d6da5cda393f + bt: e97756698880ab7555a959a5fb5c6b4e15bd64612aa677adbfe2d0bd91f0a83c + ct: cf1cbb66a638b4860a516671fb74850e6ccf787fe6c4c8d29e9c04efe880bd05 + output: + - input_file: input/dummy.in + output: + registers: + r0: + type: bool + value: "true" + initial_ast: 7e0ba7b09b3840a5d4fc9f0d413163ba2de8f207c3818f604f9a71297aac30f3 + canonicalized_ast: 3f7efb61847fd75fed58b70526da8ceffb573a0806521fb30443f341c3d14a45 + type_inferenced_ast: a1baf614c8ab13c1ff978faf8022f90eef4c482261928cb3256ab4d63e20096c diff --git a/tests/expectations/compiler/compiler/import_local/import_files.leo.out b/tests/expectations/compiler/compiler/import_local/import_files.leo.out new file mode 100644 index 0000000000..aaaee96823 --- /dev/null +++ b/tests/expectations/compiler/compiler/import_local/import_files.leo.out @@ -0,0 +1,21 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - circuit: + num_public_variables: 0 + num_private_variables: 1 + num_constraints: 1 + at: 042610d0fd1fe6d6ac112138f8755752f44c7d2a00f1b5960574d6da5cda393f + bt: e97756698880ab7555a959a5fb5c6b4e15bd64612aa677adbfe2d0bd91f0a83c + ct: cf1cbb66a638b4860a516671fb74850e6ccf787fe6c4c8d29e9c04efe880bd05 + output: + - input_file: input/dummy.in + output: + registers: + r0: + type: bool + value: "true" + initial_ast: 042e056c86e545ce256459a0de20d44c0bae24ff406becba4330e3208c48e180 + canonicalized_ast: 6cab1ab863f40c96d5d6921e2ced0dd00ebe5e9e334d84508af708be19ae8f59 + type_inferenced_ast: 17ff3e62f1c48edfbfb1c35ed4ac542260b59153d85afeca2e707dde217dc675 diff --git a/tests/expectations/compiler/compiler/import_local/import_many.leo.out b/tests/expectations/compiler/compiler/import_local/import_many.leo.out new file mode 100644 index 0000000000..b379ba5f2e --- /dev/null +++ b/tests/expectations/compiler/compiler/import_local/import_many.leo.out @@ -0,0 +1,21 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - circuit: + num_public_variables: 0 + num_private_variables: 1 + num_constraints: 1 + at: 042610d0fd1fe6d6ac112138f8755752f44c7d2a00f1b5960574d6da5cda393f + bt: e97756698880ab7555a959a5fb5c6b4e15bd64612aa677adbfe2d0bd91f0a83c + ct: cf1cbb66a638b4860a516671fb74850e6ccf787fe6c4c8d29e9c04efe880bd05 + output: + - input_file: input/dummy.in + output: + registers: + r0: + type: bool + value: "true" + initial_ast: ad1dd786c43b4d3de69b6e162bed3f01a0a53f0643e6fd2d95f12c98dfa16855 + canonicalized_ast: ad1dd786c43b4d3de69b6e162bed3f01a0a53f0643e6fd2d95f12c98dfa16855 + type_inferenced_ast: 1c983cf518cfafbe158ee3e42aed5cb190863b09aedfc4dd34e0268160ee79e2 diff --git a/tests/expectations/compiler/compiler/import_local/import_weird_names.leo.out b/tests/expectations/compiler/compiler/import_local/import_weird_names.leo.out new file mode 100644 index 0000000000..22e000786a --- /dev/null +++ b/tests/expectations/compiler/compiler/import_local/import_weird_names.leo.out @@ -0,0 +1,21 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - circuit: + num_public_variables: 0 + num_private_variables: 1 + num_constraints: 1 + at: 042610d0fd1fe6d6ac112138f8755752f44c7d2a00f1b5960574d6da5cda393f + bt: e97756698880ab7555a959a5fb5c6b4e15bd64612aa677adbfe2d0bd91f0a83c + ct: cf1cbb66a638b4860a516671fb74850e6ccf787fe6c4c8d29e9c04efe880bd05 + output: + - input_file: input/dummy.in + output: + registers: + r0: + type: bool + value: "true" + initial_ast: 6a099d784f82bb8065c8efdd2b4018089d968a7f57cbab3406df3ec5d0612410 + canonicalized_ast: 6a099d784f82bb8065c8efdd2b4018089d968a7f57cbab3406df3ec5d0612410 + type_inferenced_ast: 58541200a815edfee41333b9b2b048add269d0924ca17457ecf9fbcbb5032ccf