Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle comments in tests #3

Open
newsch opened this issue Dec 3, 2018 · 0 comments
Open

Handle comments in tests #3

newsch opened this issue Dec 3, 2018 · 0 comments

Comments

@newsch
Copy link
Member

newsch commented Dec 3, 2018

Comments should be removed from inputs/outputs prior to testing, maybe at the initial parsing stage.

For example:
This test,

# prefix 10 (derivative (fun x-> x *. x) 4.0);;
   (* The derivative of x^2 is just 2x *)
- : float list =
[9.; 8.5; 8.33333333333332504; 8.25; 8.20000000000000284;
 8.16666666666668561; 8.14285714285715656; 8.125; 8.11111111111107519;
 8.09999999999998721]

is parsed with the comment and fails during comparison:

Failed test 3 of 5 in suite 9
  INPUT:        'prefix 10 (derivative (fun x-> x *. x +. 10.0) 4.0);;'
  EXPECTED:     '(* The derivative of x^2 + 10 is still just 2x *)\n- : float list =\n[9.; 8.5; 8.33333333333332504; 8.25; 8.20000000000000284;\n 8.16666666666668561; 8.14285714285715656; 8.125; 8.11111111111107519;\n 8.09999999999998721]'
  OUTPUT:       '- : float list =\n[9.; 8.5; 8.33333333333332504; 8.25; 8.20000000000000284;\n 8.16666666666668561; 8.14285714285715656; 8.125; 8.11111111111107519;\n 8.09999999999998721]\n'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant