Skip to content

Handle comments in tests #3

@newsch

Description

@newsch

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'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions