Guest User

Untitled

a guest
Feb 18th, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. type = require './src/text'
  2. # Add the random generation functions
  3. require './test/text'
  4.  
  5. fs = require 'fs'
  6.  
  7. file = fs.createWriteStream 'ops.json', {flags:'w'}
  8. write = (data) -> file.write JSON.stringify(data) + '\n'
  9.  
  10. for [1..10000]
  11. doc = type.generateRandomDoc()
  12. [op1] = type.generateRandomOp doc
  13. [op2] = type.generateRandomOp doc
  14.  
  15. op2_ = type.transform op2, op1, 1
  16. result = [op1, op2_].reduce type.apply, doc
  17.  
  18. write {doc, op1, op2, result}
  19.  
  20. file.end()
Add Comment
Please, Sign In to add comment