Sha256: fa969fcf8fda643fc17e1f951c9fe93c09fadba6def39469d1c6161822e5a344

Contents?: true

Size: 1.19 KB

Versions: 26

Compression:

Stored size: 1.19 KB

Contents

open Core.Std

open Utils

type parameter =
  | Null
  | String of string
  | Float of float
  | Int of int
  | Bool of bool
  | StringList of (string list)
  | IntList of (int list)
  | IntStringMap of ((string * int) list) [@@deriving eq, show]

type 'a elements = (string * 'a) list [@@deriving eq, show]

type case = {
  description: string;
  parameters: parameter elements;
  expected: parameter;
} [@@deriving eq, show]

type test = {name: string; cases: case list} [@@deriving eq, show]

type tests =
  | Single of case list
  | Suite of test list [@@deriving eq, show]

let surround (ch: char) (s: string): string =
  Char.to_string ch ^ s ^ Char.to_string ch

let parameter_to_string = function
  | Null -> "null"
  | String s -> String.escaped s
  | Float f -> Float.to_string f
  | Int n -> Int.to_string n
  | Bool b -> Bool.to_string b
  | StringList xs -> "[" ^ String.concat ~sep:"; " (List.map ~f:(surround '\"' >> String.escaped) xs) ^ "]"
  | IntList xs -> "[" ^ String.concat ~sep:"; " (List.map ~f:Int.to_string xs) ^ "]"
  | IntStringMap xs -> "[" ^ String.concat ~sep:"; "
                         (List.map xs ~f:(fun (k,v) -> "(\"" ^ String.escaped k ^ "\", " ^ Int.to_string v ^ ")")) ^ "]"

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
trackler-2.0.6.0 tracks/ocaml/tools/test-generator/src/model.ml
trackler-2.0.5.18 tracks/ocaml/tools/test-generator/src/model.ml
trackler-2.0.5.17 tracks/ocaml/tools/test-generator/src/model.ml
trackler-2.0.5.16 tracks/ocaml/tools/test-generator/src/model.ml
trackler-2.0.5.15 tracks/ocaml/tools/test-generator/src/model.ml
trackler-2.0.5.14 tracks/ocaml/tools/test-generator/src/model.ml
trackler-2.0.5.13 tracks/ocaml/tools/test-generator/src/model.ml
trackler-2.0.5.12 tracks/ocaml/tools/test-generator/src/model.ml
trackler-2.0.5.11 tracks/ocaml/tools/test-generator/src/model.ml
trackler-2.0.5.10 tracks/ocaml/tools/test-generator/src/model.ml
trackler-2.0.5.9 tracks/ocaml/tools/test-generator/src/model.ml
trackler-2.0.5.8 tracks/ocaml/tools/test-generator/src/model.ml
trackler-2.0.5.7 tracks/ocaml/tools/test-generator/src/model.ml
trackler-2.0.5.6 tracks/ocaml/tools/test-generator/src/model.ml
trackler-2.0.5.5 tracks/ocaml/tools/test-generator/src/model.ml
trackler-2.0.5.4 tracks/ocaml/tools/test-generator/src/model.ml
trackler-2.0.5.3 tracks/ocaml/tools/test-generator/src/model.ml
trackler-2.0.5.2 tracks/ocaml/tools/test-generator/src/model.ml
trackler-2.0.5.1 tracks/ocaml/tools/test-generator/src/model.ml
trackler-2.0.5.0 tracks/ocaml/tools/test-generator/src/model.ml