diff options
author | Pierre-Marie Pédrot <pierre-marie.pedrot@inria.fr> | 2017-11-23 10:55:32 +0100 |
---|---|---|
committer | Pierre-Marie Pédrot <pierre-marie.pedrot@inria.fr> | 2017-11-23 10:57:10 +0100 |
commit | 7b3caccd054b6c912d4ded5c93d6b603c94904d2 (patch) | |
tree | d917d07e1ce497ca4ca557b9fcd01611fff1e1fe /checker | |
parent | 7d541f25751838e1cde2a292a71afaa28879b753 (diff) |
Truncate strings in votour to 1024 characters.
Making it bigger is kind of useless, takes time and clutters the output for
no real advantage.
Diffstat (limited to 'checker')
-rw-r--r-- | checker/votour.ml | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/checker/votour.ml b/checker/votour.ml index 95b9f2332..b7c898232 100644 --- a/checker/votour.ml +++ b/checker/votour.ml @@ -10,6 +10,8 @@ open Values (** {6 Interactive visit of a vo} *) +let max_string_length = 1024 + let rec read_num max = let quit () = Printf.printf "\nGoodbye!\n%!"; @@ -158,7 +160,8 @@ let get_string_in_tuple o = for i = 0 to Array.length o - 1 do match Repr.repr o.(i) with | STRING s -> - raise (TupleString (Printf.sprintf " [..%s..]" s)) + let len = min max_string_length (String.length s) in + raise (TupleString (Printf.sprintf " [..%s..]" (String.sub s 0 len))) | _ -> () done; "" @@ -168,7 +171,8 @@ let get_string_in_tuple o = let rec get_details v o = match v, Repr.repr o with | (String | Any), STRING s -> - Printf.sprintf " [%s]" (String.escaped s) + let len = min max_string_length (String.length s) in + Printf.sprintf " [%s]" (String.escaped (String.sub s 0 len)) |Tuple (_,v), BLOCK (_, o) -> get_string_in_tuple o |(Sum _|Any), BLOCK (tag, _) -> Printf.sprintf " [tag=%i]" tag |