Skip to content

Commit

Permalink
Add test for stripping location in exception class
Browse files Browse the repository at this point in the history
  • Loading branch information
xvw committed Apr 19, 2024
1 parent 98ad63d commit c525fda
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions test/location.t/files/location.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
let a = ""
10 changes: 10 additions & 0 deletions test/location.t/run.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
$ merl-an behavior \
> --merlin "merlin_mock exception" \
> --cache=no-cache \
> --project=files/location.ml \
> --sample-size=1 \
> --data=test-data
> cat test-data/full_responses.json
{"sample_id":6,"cmd":"merlin_mock exception single errors -filename files/location.ml < files/location.ml","responses":[{"class":"exception","value":"Not_found\nRaised at Ocaml_typing__Ident.find_same in file \"src/ocaml/typing/ident.ml\", line **, characters **-**\nCalled from Ocaml_typing__Env.IdTbl.find_same in file \"src/ocaml/typing/env.ml\", line **, characters **-**\nRe-raised at Ocaml_typing__Env.IdTbl.find_same in file \"src/ocaml/typing/env.ml\", line **, characters **-**\nCalled from Ocaml_typing__Env.find_type in file \"src/ocaml/typing/env.ml\" (inlined), line **, characters **-**\nCalled from Merlin_analysis__Browse_tree.normalize_type_expr in file \"src/analysis/browse_tree.ml\", line **, characters **-**\nCalled from Merlin_analysis__Browse_tree.same_constructor.get_decls in file \"src/analysis/browse_tree.ml\", line **, characters **-**\nCalled from Merlin_analysis__Browse_tree.same_constructor in file \"src/analysis/browse_tree.ml\", line **, characters **-**\nCalled from Merlin_analysis__Browse_tree.all_constructor_occurrences.aux in file \"src/analysis/browse_tree.ml\", line **, characters **-**\nCalled from Stdlib__List.fold_left in file \"list.ml\", line **, characters **-**\nCalled from Stdlib__List.fold_left in file \"list.ml\", line **, characters **-**\nCalled from Stdlib__List.fold_left in file \"list.ml\", line **, characters **-**\nCalled from Stdlib__List.fold_left in file \"list.ml\", line **, characters **-**\nCalled from Stdlib__List.fold_left in file \"list.ml\", line **, characters **-**\nCalled from Stdlib__List.fold_left in file \"list.ml\", line **, characters **-**\nCalled from Query_commands.dispatch.constructor_occurrence in file \"src/frontend/query_commands.ml\", line **, characters **-**\nCalled from Dune__exe__New_commands.run in file \"src/frontend/ocamlmerlin/new/new_commands.ml\", line **, characters **-**\nCalled from Merlin_utils__Std.let_ref in file \"src/utils/std.ml\", line **, characters **-**\nRe-raised at Merlin_utils__Std.let_ref in file \"src/utils/std.ml\", line **, characters **-**\nCalled from Merlin_utils__Misc.try_finally in file \"src/utils/misc.ml\", line **, characters **-**\nRe-raised at Merlin_utils__Misc.try_finally in file \"src/utils/misc.ml\", line **, characters **-**\nCalled from Stdlib__Fun.protect in file \"fun.ml\", line **, characters **-**\nRe-raised at Stdlib__Fun.protect in file \"fun.ml\", line **, characters **-**\nCalled from Merlin_kernel__Mocaml.with_state in file \"src/kernel/mocaml.ml\", line **, characters **-**\nRe-raised at Merlin_kernel__Mocaml.with_state in file \"src/kernel/mocaml.ml\", line **, characters **-**\nCalled from Dune__exe__New_merlin.run.(fun) in file \"src/frontend/ocamlmerlin/new/new_merlin.ml\", line **, characters **-**\n"}]}
{"sample_id":1,"cmd":"merlin_mock exception single type-enclosing -position '1:9' -index 0 -filename files/location.ml < files/location.ml","responses":[{"class":"exception","value":"Not_found\nRaised at Ocaml_typing__Ident.find_same in file \"src/ocaml/typing/ident.ml\", line **, characters **-**\nCalled from Ocaml_typing__Env.IdTbl.find_same in file \"src/ocaml/typing/env.ml\", line **, characters **-**\nRe-raised at Ocaml_typing__Env.IdTbl.find_same in file \"src/ocaml/typing/env.ml\", line **, characters **-**\nCalled from Ocaml_typing__Env.find_type in file \"src/ocaml/typing/env.ml\" (inlined), line **, characters **-**\nCalled from Merlin_analysis__Browse_tree.normalize_type_expr in file \"src/analysis/browse_tree.ml\", line **, characters **-**\nCalled from Merlin_analysis__Browse_tree.same_constructor.get_decls in file \"src/analysis/browse_tree.ml\", line **, characters **-**\nCalled from Merlin_analysis__Browse_tree.same_constructor in file \"src/analysis/browse_tree.ml\", line **, characters **-**\nCalled from Merlin_analysis__Browse_tree.all_constructor_occurrences.aux in file \"src/analysis/browse_tree.ml\", line **, characters **-**\nCalled from Stdlib__List.fold_left in file \"list.ml\", line **, characters **-**\nCalled from Stdlib__List.fold_left in file \"list.ml\", line **, characters **-**\nCalled from Stdlib__List.fold_left in file \"list.ml\", line **, characters **-**\nCalled from Stdlib__List.fold_left in file \"list.ml\", line **, characters **-**\nCalled from Stdlib__List.fold_left in file \"list.ml\", line **, characters **-**\nCalled from Stdlib__List.fold_left in file \"list.ml\", line **, characters **-**\nCalled from Query_commands.dispatch.constructor_occurrence in file \"src/frontend/query_commands.ml\", line **, characters **-**\nCalled from Dune__exe__New_commands.run in file \"src/frontend/ocamlmerlin/new/new_commands.ml\", line **, characters **-**\nCalled from Merlin_utils__Std.let_ref in file \"src/utils/std.ml\", line **, characters **-**\nRe-raised at Merlin_utils__Std.let_ref in file \"src/utils/std.ml\", line **, characters **-**\nCalled from Merlin_utils__Misc.try_finally in file \"src/utils/misc.ml\", line **, characters **-**\nRe-raised at Merlin_utils__Misc.try_finally in file \"src/utils/misc.ml\", line **, characters **-**\nCalled from Stdlib__Fun.protect in file \"fun.ml\", line **, characters **-**\nRe-raised at Stdlib__Fun.protect in file \"fun.ml\", line **, characters **-**\nCalled from Merlin_kernel__Mocaml.with_state in file \"src/kernel/mocaml.ml\", line **, characters **-**\nRe-raised at Merlin_kernel__Mocaml.with_state in file \"src/kernel/mocaml.ml\", line **, characters **-**\nCalled from Dune__exe__New_merlin.run.(fun) in file \"src/frontend/ocamlmerlin/new/new_merlin.ml\", line **, characters **-**\n"}]}
{"sample_id":0,"cmd":"merlin_mock exception single case-analysis -start '1:8' -end '1:9' -filename files/location.ml < files/location.ml","responses":[{"class":"exception","value":"Not_found\nRaised at Ocaml_typing__Ident.find_same in file \"src/ocaml/typing/ident.ml\", line **, characters **-**\nCalled from Ocaml_typing__Env.IdTbl.find_same in file \"src/ocaml/typing/env.ml\", line **, characters **-**\nRe-raised at Ocaml_typing__Env.IdTbl.find_same in file \"src/ocaml/typing/env.ml\", line **, characters **-**\nCalled from Ocaml_typing__Env.find_type in file \"src/ocaml/typing/env.ml\" (inlined), line **, characters **-**\nCalled from Merlin_analysis__Browse_tree.normalize_type_expr in file \"src/analysis/browse_tree.ml\", line **, characters **-**\nCalled from Merlin_analysis__Browse_tree.same_constructor.get_decls in file \"src/analysis/browse_tree.ml\", line **, characters **-**\nCalled from Merlin_analysis__Browse_tree.same_constructor in file \"src/analysis/browse_tree.ml\", line **, characters **-**\nCalled from Merlin_analysis__Browse_tree.all_constructor_occurrences.aux in file \"src/analysis/browse_tree.ml\", line **, characters **-**\nCalled from Stdlib__List.fold_left in file \"list.ml\", line **, characters **-**\nCalled from Stdlib__List.fold_left in file \"list.ml\", line **, characters **-**\nCalled from Stdlib__List.fold_left in file \"list.ml\", line **, characters **-**\nCalled from Stdlib__List.fold_left in file \"list.ml\", line **, characters **-**\nCalled from Stdlib__List.fold_left in file \"list.ml\", line **, characters **-**\nCalled from Stdlib__List.fold_left in file \"list.ml\", line **, characters **-**\nCalled from Query_commands.dispatch.constructor_occurrence in file \"src/frontend/query_commands.ml\", line **, characters **-**\nCalled from Dune__exe__New_commands.run in file \"src/frontend/ocamlmerlin/new/new_commands.ml\", line **, characters **-**\nCalled from Merlin_utils__Std.let_ref in file \"src/utils/std.ml\", line **, characters **-**\nRe-raised at Merlin_utils__Std.let_ref in file \"src/utils/std.ml\", line **, characters **-**\nCalled from Merlin_utils__Misc.try_finally in file \"src/utils/misc.ml\", line **, characters **-**\nRe-raised at Merlin_utils__Misc.try_finally in file \"src/utils/misc.ml\", line **, characters **-**\nCalled from Stdlib__Fun.protect in file \"fun.ml\", line **, characters **-**\nRe-raised at Stdlib__Fun.protect in file \"fun.ml\", line **, characters **-**\nCalled from Merlin_kernel__Mocaml.with_state in file \"src/kernel/mocaml.ml\", line **, characters **-**\nRe-raised at Merlin_kernel__Mocaml.with_state in file \"src/kernel/mocaml.ml\", line **, characters **-**\nCalled from Dune__exe__New_merlin.run.(fun) in file \"src/frontend/ocamlmerlin/new/new_merlin.ml\", line **, characters **-**\n"}]}

0 comments on commit c525fda

Please sign in to comment.