Returns whether the given lists or strings containing lines separated using newline characters contain exactly the same data.
(lines=None, matches=None)
| 175 | |
| 176 | |
| 177 | def match_exact(lines=None, matches=None): |
| 178 | """ |
| 179 | Returns whether the given lists or strings containing lines separated |
| 180 | using newline characters contain exactly the same data. |
| 181 | |
| 182 | """ |
| 183 | if not type(lines) is ListType: |
| 184 | lines = split(lines, "\n") |
| 185 | if not type(matches) is ListType: |
| 186 | matches = split(matches, "\n") |
| 187 | if len(lines) != len(matches): |
| 188 | return |
| 189 | for i in range(len(lines)): |
| 190 | if lines[i] != matches[i]: |
| 191 | return |
| 192 | return 1 |
| 193 | |
| 194 | |
| 195 | def match_re(lines=None, res=None): |