|
| 1 | +" This file is automatically generated by test-syntax from testing.vim |
| 2 | + |
| 3 | +fun! Test_if() abort |
| 4 | + call TestSyntax(g:test_packdir . '/testdata/if.zsh', |
| 5 | + \ [ |
| 6 | + \ [['zshComment', 1, 50]], |
| 7 | + \ [], |
| 8 | + \ [['zshConditional', 1, 3], ['zshDeref', 6, 10], ['zshOperator', 12, 13], ['zshConditional', 14, 17]], |
| 9 | + \ [], |
| 10 | + \ [['zshConditional', 1, 5], ['zshDeref', 9, 13], ['zshOperator', 16, 17], ['zshConditional', 18, 21]], |
| 11 | + \ [], |
| 12 | + \ [['zshConditional', 1, 5], ['zshSubstDelim', 6, 8], ['zshDeref', 9, 13], ['zshSubstDelim', 14, 14], ['zshOperator', 16, 17], ['zshConditional', 18, 21]], |
| 13 | + \ [], |
| 14 | + \ [['zshConditional', 1, 2]], |
| 15 | + \ [], |
| 16 | + \ [['zshConditional', 1, 3], ['zshSubstDelim', 4, 6], ['zshSubstDelim', 14, 14], ['zshOperator', 15, 16], ['zshDelimiter', 17, 18]], |
| 17 | + \ [], |
| 18 | + \ [['zshConditional', 1, 5], ['zshSubstDelim', 9, 11], ['zshSubstDelim', 19, 20], ['zshNumber', 25, 27], ['zshOperator', 30, 31], ['zshConditional', 32, 35]], |
| 19 | + \ [], |
| 20 | + \ [['zshConditional', 1, 5], ['zshSubstDelim', 6, 8], ['zshSubstDelim', 9, 11], ['zshSubstDelim', 19, 20], ['zshNumber', 23, 25], ['zshSubstDelim', 26, 26], ['zshOperator', 28, 29], ['zshConditional', 30, 33]], |
| 21 | + \ [], |
| 22 | + \ [['zshConditional', 1, 2]], |
| 23 | + \ [], |
| 24 | + \ [['zshSubstDelim', 4, 6], ['zshSubstDelim', 14, 15], ['zshNumber', 20, 22], ['zshOperator', 26, 28], ['zshCommands', 29, 34]], |
| 25 | + \ [['zshSubstDelim', 1, 3], ['zshSubstDelim', 4, 6], ['zshSubstDelim', 14, 15], ['zshNumber', 18, 20], ['zshSubstDelim', 21, 23], ['zshOperator', 26, 28], ['zshCommands', 29, 34]], |
| 26 | + \ [], |
| 27 | + \ [['zshComment', 1, 38]], |
| 28 | + \ [['zshOperator', 12, 12], ['zshSubstDelim', 14, 14], ['zshNumber', 16, 17], ['zshNumber', 18, 18], ['zshSubstDelim', 19, 19], ['zshOperator', 21, 23], ['zshCommands', 24, 29]], |
| 29 | + \ [], |
| 30 | + \ [['zshComment', 1, 1], ['zshTodo', 3, 3], ['zshComment', 7, 71]], |
| 31 | + \ [['zshVariableDef', 3, 4], ['zshOperator', 9, 11], ['zshVariableDef', 13, 14]], |
| 32 | + \ ]) |
| 33 | +endfun |
| 34 | + |
| 35 | +fun! Test_quotes() abort |
| 36 | + call TestSyntax(g:test_packdir . '/testdata/quotes.zsh', |
| 37 | + \ [ |
| 38 | + \ [['zshComment', 1, 15]], |
| 39 | + \ [], |
| 40 | + \ [['zshStringDelimiter', 2, 2], ['zshString', 3, 3], ['zshStringDelimiter', 9, 10], ['zshStringDelimiter', 13, 13], ['zshString', 14, 14], ['zshStringDelimiter', 23, 24], ['zshStringDelimiter', 27, 27], ['zshString', 28, 28], ['zshStringDelimiter', 40, 41], ['zshStringDelimiter', 44, 44], ['zshString', 45, 45], ['zshStringDelimiter', 62, 62]], |
| 41 | + \ [['zshStringDelimiter', 2, 2], ['zshString', 3, 3], ['zshStringDelimiter', 9, 10], ['zshStringDelimiter', 13, 13], ['zshString', 14, 14], ['zshDeref', 19, 19], ['zshStringDelimiter', 23, 24], ['zshStringDelimiter', 27, 27], ['zshString', 28, 28], ['zshSubstDelim', 35, 35], ['zshString', 37, 37], ['zshSubstDelim', 39, 39], ['zshStringDelimiter', 40, 41], ['zshStringDelimiter', 44, 44], ['zshString', 45, 45], ['zshQuoted', 50, 50], ['zshString', 52, 52], ['zshQuoted', 53, 53], ['zshString', 55, 55], ['zshQuoted', 58, 58], ['zshString', 60, 60], ['zshStringDelimiter', 62, 62], ['zshComment', 63, 63], ['zshTodo', 66, 66], ['zshComment', 70, 103]], |
| 42 | + \ [['zshStringDelimiter', 1, 1], ['zshPOSIXString', 3, 3], ['zshStringDelimiter', 9, 10], ['zshStringDelimiter', 12, 12], ['zshPOSIXString', 14, 14], ['zshStringDelimiter', 23, 24], ['zshStringDelimiter', 26, 26], ['zshPOSIXString', 28, 28], ['zshStringDelimiter', 40, 41], ['zshStringDelimiter', 43, 43], ['zshPOSIXString', 45, 45], ['zshQuoted', 50, 50], ['zshPOSIXString', 52, 52], ['zshPOSIXQuoted', 53, 53], ['zshPOSIXString', 57, 57], ['zshPOSIXQuoted', 58, 58], ['zshStringDelimiter', 62, 62]], |
| 43 | + \ [['zshSubstDelim', 2, 2], ['zshOldSubst', 3, 3], ['zshSubstDelim', 9, 10], ['zshSubstDelim', 13, 13], ['zshOldSubst', 14, 14], ['zshDeref', 19, 19], ['zshSubstDelim', 23, 24], ['zshSubstDelim', 27, 27], ['zshOldSubst', 28, 28], ['zshSubstDelim', 35, 35], ['zshOldSubst', 37, 37], ['zshSubstDelim', 39, 41], ['zshSubstDelim', 44, 44], ['zshOldSubst', 45, 45], ['zshQuoted', 50, 50], ['zshOldSubst', 52, 52], ['zshPOSIXQuoted', 53, 53], ['zshOldSubst', 57, 57], ['zshPOSIXQuoted', 58, 58], ['zshSubstDelim', 62, 62]], |
| 44 | + \ [], |
| 45 | + \ [['zshStringDelimiter', 1, 1], ['zshString', 2, 2], ['zshStringDelimiter', 8, 9], ['zshStringDelimiter', 10, 10], ['zshSubstDelim', 11, 11], ['zshOldSubst', 12, 12], ['zshSubstDelim', 16, 16], ['zshStringDelimiter', 17, 17]], |
| 46 | + \ [['zshStringDelimiter', 1, 1], ['zshString', 2, 2], ['zshStringDelimiter', 8, 9], ['zshStringDelimiter', 10, 10], ['zshString', 11, 11], ['zshStringDelimiter', 17, 17]], |
| 47 | + \ [], |
| 48 | + \ [['zshStringDelimiter', 2, 2], ['zshString', 3, 3], ['zshQuoted', 11, 11], ['zshString', 13, 13], ['zshQuoted', 14, 14], ['zshString', 16, 16], ['zshQuoted', 17, 17], ['zshString', 19, 19], ['zshQuoted', 20, 20], ['zshString', 22, 22], ['zshStringDelimiter', 29, 29]], |
| 49 | + \ [['zshStringDelimiter', 2, 2], ['zshString', 3, 3], ['zshStringDelimiter', 15, 16], ['zshQuoted', 17, 19], ['zshQuoted', 20, 22], ['zshStringDelimiter', 29, 29], ['zshString', 30, 30], ['zshStringDelimiter', 57, 58]], |
| 50 | + \ [['zshStringDelimiter', 1, 1], ['zshPOSIXString', 3, 3], ['zshQuoted', 11, 11], ['zshPOSIXString', 13, 13], ['zshQuoted', 14, 14], ['zshPOSIXString', 16, 16], ['zshQuoted', 17, 17], ['zshPOSIXString', 19, 19], ['zshQuoted', 20, 20], ['zshPOSIXString', 22, 22], ['zshStringDelimiter', 29, 29]], |
| 51 | + \ ]) |
| 52 | +endfun |
| 53 | + |
| 54 | +fun! Test_var() abort |
| 55 | + call TestSyntax(g:test_packdir . '/testdata/var.zsh', |
| 56 | + \ [ |
| 57 | + \ [['zshComment', 1, 16]], |
| 58 | + \ [], |
| 59 | + \ [['zshComment', 1, 29]], |
| 60 | + \ [['zshVariableDef', 1, 2]], |
| 61 | + \ [['zshVariableDef', 1, 4]], |
| 62 | + \ [['zshTypes', 1, 6], ['zshVariableDef', 7, 8]], |
| 63 | + \ [['zshTypes', 1, 8], ['zshVariableDef', 12, 13]], |
| 64 | + \ [], |
| 65 | + \ [['zshCommands', 1, 6], ['zshDeref', 7, 8]], |
| 66 | + \ [['zshCommands', 1, 6], ['zshSubstDelim', 7, 7], ['zshSubst', 9, 9], ['zshSubstDelim', 10, 10]], |
| 67 | + \ [], |
| 68 | + \ [['zshCommands', 1, 6], ['zshDeref', 7, 9], ['zshComment', 11, 11], ['zshTodo', 15, 15], ['zshComment', 19, 57]], |
| 69 | + \ [['zshCommands', 1, 6], ['zshSubstDelim', 7, 7], ['zshSubst', 9, 9], ['zshSubstDelim', 12, 12]], |
| 70 | + \ [], |
| 71 | + \ [['zshCommands', 1, 6], ['zshSubstDelim', 7, 7], ['zshSubst', 9, 9], ['zshSubstDelim', 15, 15]], |
| 72 | + \ [['zshCommands', 1, 6], ['zshDeref', 7, 11], ['zshNumber', 12, 13], ['zshComment', 14, 14], ['zshTodo', 19, 19], ['zshComment', 23, 69]], |
| 73 | + \ [['zshCommands', 1, 6], ['zshSubstDelim', 7, 7], ['zshSubst', 9, 9], ['zshSubstDelim', 15, 15]], |
| 74 | + \ [['zshCommands', 1, 6], ['zshDeref', 7, 11]], |
| 75 | + \ [], |
| 76 | + \ [['zshCommands', 1, 6], ['zshSubstDelim', 7, 7], ['zshSubst', 9, 9], ['zshSubstDelim', 18, 18]], |
| 77 | + \ [['zshCommands', 1, 6], ['zshSubstDelim', 7, 7], ['zshSubst', 9, 9], ['zshSubstDelim', 18, 18]], |
| 78 | + \ [], |
| 79 | + \ [['zshCommands', 1, 6], ['zshShortDeref', 7, 9], ['zshShortDeref', 10, 12], ['zshDeref', 13, 15], ['zshShortDeref', 16, 17]], |
| 80 | + \ ]) |
| 81 | +endfun |
0 commit comments