diff options
Diffstat (limited to 'scripts/migrate_ref_tests.rb')
-rwxr-xr-x | scripts/migrate_ref_tests.rb | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/scripts/migrate_ref_tests.rb b/scripts/migrate_ref_tests.rb deleted file mode 100755 index 5ed02893..00000000 --- a/scripts/migrate_ref_tests.rb +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/env ruby - -require 'json' - -Dir.glob('./tests/ref/**/grid.json').each do |path| - puts "Migrating #{path}" - - # Read contents - s = File.open(path) { |f| f.read } - - # Parse - grid = JSON.parse(s) - - # Normalize Storage serialization - if grid['raw'].is_a? Array - grid['raw'] = { - 'inner' => grid['raw'][0], - 'zero' => grid['raw'][1], - 'visible_lines' => grid['raw'][2] - } - end - - # Migrate Row serialization - grid['raw']['inner'].map! do |row| - if row.is_a? Hash - row - else - { inner: row, occ: row.length } - end - end - - # Write updated grid - File.open(path, 'w') { |f| f << JSON.generate(grid) } -end |