Last active
December 21, 2015 18:19
-
-
Save dstj/6346872 to your computer and use it in GitHub Desktop.
This AutoHotKey script facilitates comparing Resharper tests results where one-liner JSON are compared by copy-pasting them, formatting them and comparing them in Notepad++ with the Compare plugin.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; Copy Paste Resharper tests one-liner JSON exptected vs actual output and compare them in Notepad++ | |
; Use by first copying ALL test output in the clipboard, and then press CTRL-ALT-WIN-C | |
^#!c:: | |
; Start Notepad++ | |
ProgramFilesX86 := A_ProgramFiles . (A_PtrSize=8 ? " (x86)" : "") | |
Run %ProgramFilesX86%\Notepad++\notepad++.exe -multiInst -nosession | |
WinWaitActive, new 1 - Notepad++, , 1 | |
Send ^!d | |
Sleep, 100 | |
; Paste in new document | |
Send ^n | |
Sleep, 100 | |
Send ^v | |
; Delete extra stuff | |
Send ^{Home} | |
Send {Down}{Down} | |
Send ^+{End} | |
Send {Del} | |
Send !+{Right 13}!+{Up 2} | |
Send {Del} | |
Send {End}{Backspace} | |
Send {Down}{End}{Backspace} | |
; Extract JSON to compare | |
Send {Home} | |
Send +{End} | |
Send ^x | |
; Format first JSON | |
Send ^a | |
Send ^!+m | |
Sleep, 100 | |
Send ^{Home} | |
Send Expected | |
; Paste second JSON and format | |
Send ^n | |
Sleep, 100 | |
Send ^v | |
Send ^a | |
Send ^!+m | |
Sleep, 100 | |
Send ^{Home} | |
Send Actual | |
; Compare JSON | |
Send !d |
Thanks for merging! I deleted my fork.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To solve an issue where starting a comparison while a notepad++ instance is already open, this fork will always start a new no-session instance of notepad++: https://gist.github.com/christianrondeau/6353811