Check incremental results against full evaluation

This commit is contained in:
milner committed 2017-06-03 09:23:00 +00:00
1 parent dc1e1e9b03
commit 10be5334b1
3 files changed
+131

No files matched your search

+15
View File
@@ -370,3 +370,18 @@ let batch_cases =
(Change.to_string (Change.CCollection changes))))
(Util.list_init 120 (fun index -> index + 1)) );
]
let rec value_for rng records ty =
match Types.repr ty with
| Types.TInt -> Value.VInt (range rng 41 - 20)
| Types.TBool -> Value.VBool (range rng 2 = 0)
| Types.TString -> Value.VString (word rng)
| Types.TUnit -> Value.VUnit
| Types.TTuple items -> Value.VTuple (List.map (value_for rng records) items)
| Types.TRecord name -> (
match Types.record_info records name with
| Some info ->
Value.VRecord
(name, List.map (fun (label, field_ty) -> (label, value_for rng records field_ty)) info.Types.ri_fields)
| None -> Value.VUnit)
| Types.TCollection _ | Types.TArrow _ | Types.TVar _ -> Value.VUnit