PageRenderTime 43ms CodeModel.GetById 16ms RepoModel.GetById 0ms app.codeStats 0ms

/lib/syntaxhighlighter_3.0.83/tests/cases/010_highlight.html

#
HTML | 70 lines | 62 code | 8 blank | 0 comment | 0 complexity | 22bcff1ca56ab31b4be0d78e72437279 MD5 | raw file
Possible License(s): LGPL-2.1, Apache-2.0, BSD-3-Clause
  1. <pre id="sh_010_highlight_a" class="brush: groovy; highlight: 2">
  2. public function validateStrongPassword(password:String):Boolean
  3. {
  4. if (password == null || password.length <= 0)
  5. {
  6. return false;
  7. }
  8. return STRONG_PASSWORD_PATTERN.test(password);
  9. }
  10. </pre>
  11. <script id="sh_010_highlight_b" type="syntaxhighlighter" class="brush: as3; highlight: [2, 4, 12]"><![CDATA[
  12. /**
  13. * Checks a password and returns a value indicating whether the password is a "strong"
  14. * password. The criteria for a strong password are:
  15. *
  16. * <ul>
  17. * <li>Minimum 8 characters</li>
  18. * <li>Maxmium 32 characters</li>
  19. * <li>Contains at least one lowercase letter</li>
  20. * <li>Contains at least one uppercase letter</li>
  21. * <li>Contains at least one number or symbol character</li>
  22. * </ul>
  23. *
  24. * @param password The password to check
  25. *
  26. * @return A value indicating whether the password is a strong password (<code>true</code>)
  27. * or not (<code>false</code>).
  28. */
  29. public function validateStrongPassword(password:String):Boolean
  30. {
  31. if (password == null || password.length <= 0)
  32. {
  33. return false;
  34. }
  35. return STRONG_PASSWORD_PATTERN.test(password);
  36. }
  37. ]]></script>
  38. <script type="text/javascript">
  39. queue(function()
  40. {
  41. var $sh;
  42. module('010_highlight');
  43. test('one highlighted line', function()
  44. {
  45. $sh = $('#sh_010_highlight_a');
  46. ok_sh($sh);
  47. ok_toolbar($sh);
  48. ok_code($sh);
  49. ok($sh.find('.gutter .number2').is('.highlighted'), 'Line 2 is highlighted');
  50. });
  51. test('multiple highlighted lines', function()
  52. {
  53. $sh = $('#sh_010_highlight_b');
  54. ok_sh($sh);
  55. ok_toolbar($sh);
  56. ok_code($sh);
  57. ok($sh.find('.gutter .number2').is('.highlighted'), 'Line 2 is highlighted');
  58. ok($sh.find('.gutter .number4').is('.highlighted'), 'Line 4 is highlighted');
  59. ok($sh.find('.gutter .number12').is('.highlighted'), 'Line 12 is highlighted');
  60. });
  61. });
  62. </script>