i'm working on plug-in vim, , i'd test behaves correctly, under start-up, when users edit files e.t.c. to this, i'd start terminal, , feed keys in it. i'm thinking of doing python script. there way this? in pseudo-python might this: #start terminal. here konsole konsole = os.system('konsole --width=200 --height=150') #start vim in terminal konsole.feed_keys("vim\n") #run vim function tested konsole.feed_keys(":let my_list = myvimfunction()\n") #save return value file system konsole.feed_keys(":writefile(my_list, '/tmp/result')\n") #load result python open('/tmp/result', 'r') myfile: data = myfile.read() #validate result assertequal('expect result', data) i think should verify core functionality of plugin inside vim, using unit tests. there's wide variety of vim plugins, provide additional mappings or commands, invoked user, , leave behind side effects in buffer, or output...
Comments
Post a Comment