Yesterday, Andy Lester opened an issue for vim-perl on github about adding an automated test suite. I’ve thought about doing something like this before, so last night got busy with prototyping a test harness.
What I’ve got so far (in my fork) is a test file that uses Text::VimColor to generate HTML and compare it against a reference HTML document to determine if the syntax file is doing its job. If a reference file can’t be found, it will create it and skip that test. Here’s what it looks like:
$ make test prove -rv t t/01_highlighting.t .. ok 1 - Correct output for t_source/perl/basic.t ok 2 # skip Created t_source/perl/advanced.t.html ok 3 - Correct output for t_source/perl6/basic.t 1..3 ok All tests successful.
In case of failure, it will use Test::Differences to show you what’s wrong, and write the incorrect output to disk for you to inspect:
$ vim syntax/perl6.vim # make a bad change $ make test prove -rv t t/01_highlighting.t .. ok 1 - Correct output for t_source/perl/basic.t ok 2 - Correct output for t_source/perl/advanced.t not ok 3 - Correct output for t_source/perl6/basic.t # Failed test 'Correct output for t_source/perl6/basic.t' # at t/01_highlighting.t line 77. # «output from Test::Differences showing the offending lines» # You can inspect the incorrect output at t_source/perl6/basic.t_fail.html 1..3 # Looks like you failed 1 test of 3. Dubious, test returned 1 (wstat 256, 0x100) Failed 1/3 subtests
The only big downside to this is that 01_highlighting.t tests all the source files in one go. You currently can’t tell it to only test one specific file.
When I was interested in writing automated tests of emacs syntax
colors I went in a slightly different direction. My idea was
to fork off a child process to exec a full emacs, then do a
screen capture of it and examine the number of colors using
imageemagick:
http://obsidianrook.com/devnotes/talks/test_everything/
Comment by Joseph Brenner — September 1, 2009 @ 5:25 pm
White breads and sugar cereals do little good try to purchase full grain varieties of these. The Extreme Fat Loss Diet is based on extensive research that Joel Marion did, using information and findings from several scientific sources.
Comment by Berry Mansbach — September 16, 2010 @ 2:06 pm
Hrmm that was weird, my comment got eaten. Anyway I wanted to say that it’s nice to know that someone else also mentioned this as I had trouble finding the same info elsewhere. This was the first place that told me the answer. Thanks. Do these people take advantage of the poor? Absolutely; there is no question about it.
Comment by Chauncey Whitherspoon — September 22, 2010 @ 2:49 pm
Very interesting and amusing subject. I read with great pleasure. His or her little hands are going to grab everything they can once the figure out they can use those fingers, and they are going to pick up all types of nasty things no matter how well you clean.
Comment by Jesse Merida — December 28, 2010 @ 6:45 am
Hey, just looking around some blogs, seems a pretty nice platform you’re using. I’m currently using Wordpress being a few as to my sites but looking how to change I as to them during how to a platform identical To yours as a trial run. Anything in particular you would recommend about this?
Comment by Barrett Appl — January 11, 2011 @ 11:59 am
Thank you, this post has been very worthile to read, I look forward to reading through more of this website.
Comment by Nova Radio — January 13, 2011 @ 1:57 pm
Nice blog, I am going to bookmark it. I look forward to future posts.
Comment by Visit Teton Valley — January 14, 2011 @ 8:01 pm
I recently came across this blog and have loved the information. I look forward to future content and will definitely link to this and tell the people I know. Thanks.
Comment by Salmon Derby — January 18, 2011 @ 3:06 pm
Wow! Thank you! I permanently wanted to write on my blog something like that. Can I take a portion of your post to my site?
Comment by Clayton Pfingsten — January 18, 2011 @ 7:52 pm
You have done a marvellous job by exploring this subject with such an honesty and depth. Thanks for sharing it with us! Within the first three weeks of its existence, the Adsense website had already reached 2,000 page views and made more than $35 on Adsense clicks.
Comment by Stephine Samuels — January 25, 2011 @ 10:58 am
i i equal it Testing vim syntax files « following the exact words thoughts at this moment im your rss reader
Comment by Rapid Gigabitz — January 26, 2011 @ 7:25 pm
Well I sincerely liked reading it. This article provided by you is very constructive for correct planning.
Comment by Luanna Wiest — February 4, 2011 @ 11:21 pm
Beneficial data and outstanding website you got here! I would like to thank you for sharing your thoughts and time into the stuff you post!! Thumbs up
Comment by Penguins Jerseys — February 15, 2011 @ 10:50 am
Just a fast hello and also to thank you for discussing your ideas on this web page. I wound up inside your weblog right after researching physical fitness connected issues on Yahoo… guess I lost track of what I had been performing! Anyway I’ll be back once again inside the future to verify out your blogposts down the road. Thanks!
Comment by small business financing — February 16, 2011 @ 4:27 am
I appreciate the time you took to post this. I am very interested in this. Thank you for your well written post
Comment by Schöne russische Frauen auf Partnersuche — March 20, 2011 @ 9:26 pm
Black Magic Spells has an amazing power when it comes to cast effective spells. Ask to a professional to cast your spells and there will be neither negative energies nor bad karma involved. I have over 30 years experience in Black Magic Spells and my clients always come back to me when they have a problem. My love spells are performed through ancestral methods giving safe, fast and powerful results!
blackmagicspells.co.cc or 0044 7017450013
Comment by black magic spells — April 27, 2011 @ 6:37 am
锘縂reat piece of writing. I just stumbled on your web sites not to mention planned to assert that i get in fact really enjoyed perusing your website items. However I鈥檒l turn out to be ever coming back not to mention Let’s hope anyone put up ever again subsequently.
Comment by Clyde Hetherington — June 20, 2011 @ 5:29 pm
This is a smash hit! The validity of the points you make in this writing are on the ball. Really great job on this article. If you have to get a chance to look at this site:**http://how-do-i-lose-weight-fast.info **. Keep up the great work, you are providing a great online resource
Comment by How do I lose weight fast — August 8, 2011 @ 9:54 pm
I would like to thank you for the efforts you’ve put in writing this website. I’m hoping the same high-grade site post from you in the upcoming also. In fact your creative writing abilities has inspired me to get my own blog now. Really the blogging is spreading its wings rapidly. Your write up is a great example of it.
Comment by web design — August 12, 2011 @ 5:18 pm
for the person who posted last night re the cost of steel ,it realy depends where you go to buy it, z45 is around seven forty pounds per metric ton and standard is around £650 per ton- hope this helps
Comment by roofing sheets — September 14, 2011 @ 9:50 pm