/pigeoncms/Plugins/syntaxhighlighter/tests/cases/006_pad_line_numbers.html

http://pigeoncms.googlecode.com/ · HTML · 39 lines · 33 code · 6 blank · 0 comment · 0 complexity · 9e16cb8f80dc084949ca54ea27c07b13 MD5 · raw file

  1. <pre id="sh_006_pad_line_numbers" class="brush: java; pad-line-numbers: true">
  2. /**
  3. * Returns an Image object that can then be painted on the screen.
  4. * The url argument must specify an absolute {@link URL}. The name
  5. * argument is a specifier that is relative to the url argument.
  6. *
  7. * @param url an absolute URL giving the base location of the image
  8. * @param name the location of the image, relative to the url argument
  9. * @return the image at the specified URL
  10. * @see Image
  11. */
  12. </pre>
  13. <script type="text/javascript">
  14. queue(function()
  15. {
  16. var $sh;
  17. module('006_pad_line_numbers');
  18. test('check that line numbers are padded with zeroes', function()
  19. {
  20. $sh = $('#sh_006_pad_line_numbers');
  21. ok_sh($sh);
  22. ok_toolbar($sh);
  23. ok_gutter($sh);
  24. ok_code($sh);
  25. $sh.find('.gutter > .line').each(function(index)
  26. {
  27. var text = $(this).text();
  28. if (parseInt(text) < 10)
  29. ok(text.charAt(0) == '0', 'Line ' + index + ' has leading zero: ' + text);
  30. });
  31. });
  32. });
  33. </script>