Giter Club home page Giter Club logo

Comments (4)

sliquister avatar sliquister commented on September 9, 2024

It's hard to line up the positions of these stack traces with the actual source code, but it should be fixable. I think it's a matter of capturing exceptions directly from the user code, whereas right now there are things like Exn.protect in between the user code and the try with.

from ppx_inline_test.

sliquister avatar sliquister commented on September 9, 2024

I have a couple of changes under review to go from:

File "source.ml", line 41, characters 0-75: rev threw
(runtime.ml.E "comparison failed"
  ((1 2 3) vs (3 2 1) (Loc sourcelib/source.ml:42:13))).
  Raised at Ppx_assert_lib__Runtime.failwith in file "runtime.ml" (inlined), line 28, characters 28-53
  Called from Ppx_assert_lib__Runtime.fail_in_sexp_style in file "runtime.ml" (inlined), line 48, characters 2-23
  Called from Ppx_assert_lib__Runtime.test_eq_failed in file "runtime.ml", line 85, characters 2-107
  Called from Ppx_inline_test_lib__Runtime.test_unit.(fun) in file "runtime.ml", line 513, characters 15-19
  Called from Base__Exn.protectx in file "exn.ml" (inlined), line 66, characters 8-11
  Called from Base__Exn.protect in file "exn.ml", line 77, characters 26-49
  Re-raised at Base__Exn.protectx in file "exn.ml" (inlined), line 71, characters 4-114
  Called from Base__Exn.protect in file "exn.ml", line 77, characters 26-49
  Called from Ppx_inline_test_lib__Runtime.time_and_reset_random_seeds in file "runtime.ml" (inlined), line 365, characters 15-52
  Called from Ppx_inline_test_lib__Runtime.test in file "runtime.ml", line 460, characters 53-84

to:

File "source.ml", line 41, characters 0-75: rev threw
(runtime.ml.E "comparison failed"
  ((1 2 3) vs (3 2 1) (Loc sourcelib/source.ml:42:13))).
  Called from Ppx_assert_lib__Runtime.test_eq in file "runtime.ml", line 85, characters 2-107
  Called from Sourcelib__source.(fun) in file "source.ml", line 42, characters 13-21

which I think is as good as it can get.

from ppx_inline_test.

yminsky avatar yminsky commented on September 9, 2024

That looks amazing. Thanks!

from ppx_inline_test.

aalekseyev avatar aalekseyev commented on September 9, 2024

This change landed in 4ad759e.

from ppx_inline_test.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.