diff --git a/src/bin/expect_tests/get_scope.ml b/src/bin/expect_tests/get_scope.ml index 7d9d4cfd3..8c365a483 100644 --- a/src/bin/expect_tests/get_scope.ml +++ b/src/bin/expect_tests/get_scope.ml @@ -240,4 +240,37 @@ let%expect_test _ = (c#4 -> c) in file "application.mligo", line 3, characters 26-27 (b#3 -> b) in file "application.mligo", line 3, characters 7-8 (a#5 -> a) in file "application.mligo", line 1, characters 4-5 + Type definitions: |} ] ; + + run_ligo_good [ "get-scope" ; gs "include.mligo" ; "--format=dev" ] ; + [%expect {| + Scopes: + [ x#6 b#5 a#0 ] in file "include.mligo", line 5, characters 12-13 + [ x#6 b#5 a#0 ] in file "include.mligo", line 5, characters 8-9 + [ b#5 a#0 ] in file "include.mligo", line 3, characters 0-9 + [ d#4 c#1 a#0 ] in file "letin.mligo", line 10, characters 10-11 + [ d#4 c#1 a#0 ] in file "letin.mligo", line 10, characters 6-7 + [ d#4 c#1 a#0 ] in file "letin.mligo", line 10, characters 2-3 + [ f#3 e#2 c#1 a#0 ] in file "letin.mligo", line 8, characters 16-17 + [ f#3 e#2 c#1 a#0 ] in file "letin.mligo", line 8, characters 12-13 + [ f#3 e#2 c#1 a#0 ] in file "letin.mligo", line 8, characters 8-9 + [ f#3 e#2 c#1 a#0 ] in file "letin.mligo", line 8, characters 4-5 + [ e#2 c#1 a#0 ] in file "letin.mligo", line 7, characters 20-21 + [ e#2 c#1 a#0 ] in file "letin.mligo", line 7, characters 16-17 + [ e#2 c#1 a#0 ] in file "letin.mligo", line 7, characters 12-13 + [ c#1 a#0 ] in file "letin.mligo", line 6, characters 16-17 + [ c#1 a#0 ] in file "letin.mligo", line 6, characters 12-13 + [ a#0 ] in file "letin.mligo", line 4, characters 14-15 + [ a#0 ] in file "letin.mligo", line 4, characters 10-11 + [ ] in file "letin.mligo", line 1, characters 0-9 + + Variable definitions: + (y#7 -> y) in file "include.mligo", line 5, characters 4-5 + (x#6 -> x) in file "include.mligo", line 3, characters 4-5 + (f#3 -> f) in file "letin.mligo", line 7, characters 8-9 + (e#2 -> e) in file "letin.mligo", line 6, characters 8-9 + (d#4 -> d) in file "letin.mligo", line 5, characters 6-7 + (c#1 -> c) in file "letin.mligo", line 4, characters 6-7 + (b#5 -> b) in file "letin.mligo", line 3, characters 4-5 + (a#0 -> a) in file "letin.mligo", line 1, characters 4-5 Type definitions: |} ] ; \ No newline at end of file diff --git a/src/test/contracts/get_scope_tests/include.mligo b/src/test/contracts/get_scope_tests/include.mligo new file mode 100644 index 000000000..b725c2632 --- /dev/null +++ b/src/test/contracts/get_scope_tests/include.mligo @@ -0,0 +1,5 @@ +#include "./letin.mligo" + +let x = 1 + +let y = x + 1 \ No newline at end of file