Real Vim ninjas count every keystroke - do you?

Pick a challenge, fire up Vim, and show us what you got.

Changelog, Rules & FAQ, updates: @vimgolf, RSS.

Your VimGolf key: please sign in

$ gem install vimgolf
$ vimgolf setup
$ vimgolf put 5ea82da50a8bcc00091923e4

Reconstruct the actual output from my unit test tool report

When a test fails, my unit test tool reports differences between the actual output and the expected output as follow: - line in the expected output but missing in the actual output are prefixed with a dash - unexpected lines in the actual output are prefixed with a plus sign - comments added by the unit test tool are prefixed with a question mark - common lines are showed `as-is` (well, almost;) From that "diff" format, I would like to reconstruct the actual output.

Start file
  {'claims': [{'add': '',
-              'mainsnak': {'property': 'P31',
+              'mainsnak': {'datatype': 'wikibase-item',
+                           'datavalue': {'type': 'wikibase-entityid',
+                                         'value': {'entity-type': 'item',
+                                                   'id': 'Q5',
+                                                   'numeric-id': 5}},
+                           'hash': 'ad7d38a03cdd40cdc373de0dc4e7b7fcbccb31d9',
+                           'property': 'P31',
-                           'snaktype': 'value',
+                           'snaktype': 'value'},
?                                              +

-                           'value': {'entity-type': 'item', 'id': 'Q5'}},
+              'qualifiers': {},
               'rank': 'normal',
               'type': 'statement'}],
   'id': 'Q44',
   'ns': 0}
End file
{'claims': [{'add': '',
             'mainsnak': {'datatype': 'wikibase-item',
                          'datavalue': {'type': 'wikibase-entityid',
                                        'value': {'entity-type': 'item',
                                                  'id': 'Q5',
                                                  'numeric-id': 5}},
                          'hash': 'ad7d38a03cdd40cdc373de0dc4e7b7fcbccb31d9',
                          'property': 'P31',
                          'snaktype': 'value'},

             'qualifiers': {},
             'rank': 'normal',
             'type': 'statement'}],
 'id': 'Q44',
 'ns': 0}

View Diff

1,12c1,9
<   {'claims': [{'add': '',
< -              'mainsnak': {'property': 'P31',
< +              'mainsnak': {'datatype': 'wikibase-item',
< +                           'datavalue': {'type': 'wikibase-entityid',
< +                                         'value': {'entity-type': 'item',
< +                                                   'id': 'Q5',
< +                                                   'numeric-id': 5}},
< +                           'hash': 'ad7d38a03cdd40cdc373de0dc4e7b7fcbccb31d9',
< +                           'property': 'P31',
< -                           'snaktype': 'value',
< +                           'snaktype': 'value'},
< ?                                              +
---
> {'claims': [{'add': '',
>              'mainsnak': {'datatype': 'wikibase-item',
>                           'datavalue': {'type': 'wikibase-entityid',
>                                         'value': {'entity-type': 'item',
>                                                   'id': 'Q5',
>                                                   'numeric-id': 5}},
>                           'hash': 'ad7d38a03cdd40cdc373de0dc4e7b7fcbccb31d9',
>                           'property': 'P31',
>                           'snaktype': 'value'},
14,19c11,15
< -                           'value': {'entity-type': 'item', 'id': 'Q5'}},
< +              'qualifiers': {},
<                'rank': 'normal',
<                'type': 'statement'}],
<    'id': 'Q44',
<    'ns': 0}
---
>              'qualifiers': {},
>              'rank': 'normal',
>              'type': 'statement'}],
>  'id': 'Q44',
>  'ns': 0}

Solutions by @jeffacce:

Unlock 2 remaining solutions by signing in and submitting your own entry
Created by: @Yes_I_Know_IT

52 active golfers, 152 entries

Solutions by @jeffacce:
21
#47 - Jeff Cui / @jeffacce

05/13/2020 at 01:40AM

27
#>49 - Jeff Cui / @jeffacce

05/13/2020 at 01:38AM