1 <pre id="sh_010_highlight_a" class="brush: groovy; highlight: 2">
2 public function validateStrongPassword(password:String):Boolean
4 if (password == null || password.length <= 0)
9 return STRONG_PASSWORD_PATTERN.test(password);
12 <script id="sh_010_highlight_b" type="syntaxhighlighter" class="brush: as3; highlight: [2, 4, 12]"><![CDATA[
14 * Checks a password and returns a value indicating whether the password is a "strong"
15 * password. The criteria for a strong password are:
18 * <li>Minimum 8 characters</li>
19 * <li>Maxmium 32 characters</li>
20 * <li>Contains at least one lowercase letter</li>
21 * <li>Contains at least one uppercase letter</li>
22 * <li>Contains at least one number or symbol character</li>
25 * @param password The password to check
27 * @return A value indicating whether the password is a strong password (<code>true</code>)
28 * or not (<code>false</code>).
30 public function validateStrongPassword(password:String):Boolean
32 if (password == null || password.length <= 0)
37 return STRONG_PASSWORD_PATTERN.test(password);
41 <script type="text/javascript">
46 module('010_highlight');
48 test('one highlighted line', function()
50 $sh = $('#sh_010_highlight_a');
55 ok($sh.find('.gutter .number2').is('.highlighted'), 'Line 2 is highlighted');
58 test('multiple highlighted lines', function()
60 $sh = $('#sh_010_highlight_b');
65 ok($sh.find('.gutter .number2').is('.highlighted'), 'Line 2 is highlighted');
66 ok($sh.find('.gutter .number4').is('.highlighted'), 'Line 4 is highlighted');
67 ok($sh.find('.gutter .number12').is('.highlighted'), 'Line 12 is highlighted');