Commit Graph

18 Commits

Author SHA1 Message Date
Simon Heimberg
3fb7bd830f check-code: do not warn on printf \\x or \\[1-9]
When there is a double backslash the following char does not have any special
meaning. So do not warn on this.
Remove the now obsolete no-check-code statement. (It was used wrongly anyway, it
skipped checking the entire file.)
2013-07-01 06:50:58 +02:00
Mads Kiilerich
fa1c4e5ebe tests: add missing trailing 'cd ..'
Many tests didn't change back from subdirectories at the end of the tests ...
and they don't have to. The missing 'cd ..' could always be added when another
test case is added to the test file.

This change do that tests (99.5%) consistently end up in $TESTDIR where they
started, thus making it simpler to extend them or move them around.
2012-06-11 01:40:51 +02:00
Jim Hague
78a686772b tests: tighten checks for octal escapes in shell printf.
printf on AIX default shell ksh (89) says \1 is an invalid escape. It insists
on at least 2 digits. This causes failures in test-keyword.t and test-status.t.

check-code.py already looks out for \NNN and recommends using Python
for outputting octal values. Extend the check to \NN and \N and fix up
resulting failures.
2012-02-08 16:56:00 +00:00
Mads Kiilerich
8c22a0ec28 tests: make (glob) on windows accept \ instead of /
Globbing is usually used for filenames, so on windows it is reasonable and very
convenient that glob patterns accepts '\' or '/' when the pattern specifies
'/'.
2011-11-07 03:25:10 +01:00
Martin Geisler
afe812d8de subrepo: try remapping subpaths using the "final" path
Before, the right-hand side of a .hgsub entry was used, as is, to
match the left-hand side of a subpaths entry. This turned out to be
less useful than expected since a .hgsub file with

  src/foo = src/foo

has little context to do remapping on. The new idea is therefore to
prefix the parent repo path *before* the remapping takes place.

If the parent repository path (as defined by _abssource) is

  http://example.net/parent

then the remapping for the above .hgsub entry will be done on the
expanded path:

  http://example.net/parent/src/foo

If this expanded path is not changed by the remapping, then we remap

  src/foo

alone. This is the old behavior where the right-hand side is remapped
without context.
2011-09-22 15:15:18 +02:00
Martin Geisler
07835d7af4 test-subrepo-paths: fix typo 2011-03-12 12:15:36 +01:00
Martin Geisler
b13a1cf275 test-subrepo-paths: test cummulative remapping 2011-03-11 12:42:07 +01:00
Mads Kiilerich
3174ff376b tests: remove redundant globs
Many globs now just match $TESTTMP and is no longer needed.
2010-10-08 22:36:10 -05:00
Erik Zielke
512d0992fc tests: removed test names in tests
The name of the test files is replaced with a glob * expression,
thereby the tests does not depend on the filename of the file they are
in.
2010-09-30 09:49:40 +02:00
Brodie Rao
b5fe0d906e tests: add glob matching for unified tests
This adds a " (glob)" marker that works like a simpler version of
(re): "*" is converted to ".*", and "?" is converted to ".".

Both special characters can be escaped using "\", and the backslash
itself can be escaped as well.

Other glob-style syntax, like "**", "[chars]", or "[!chars]", isn't
supported.
2010-09-22 16:06:02 -05:00
Brodie Rao
7d7d96bd74 tests: require regexes in unified tests to be marked with " (re)"
Consider this test:

  $ hg glog --template '{rev}:{node|short} "{desc}"\n'
  @  2:20c4f79fd7ac "3"
  |
  | o  1:38f24201dcab "2"
  |/
  o  0:2a18120dc1c9 "1"

Because each line beginning with "|" can be compiled as a regular
expression (equivalent to ".*|"), they will match any output.

Similarly:

  $ echo foo


The blank output line can be compiled as a regular expression and will
also match any output.

With this patch, none of the above output lines will be matched as
regular expressions. A line must end in " (re)" in order to be matched
as one.

Lines are still matched literally first, so the following will pass:

  $ echo 'foo (re)'
  foo (re)
2010-09-22 16:06:00 -05:00
Brodie Rao
3ed54dfa3d tests: improve regexes in unified tests 2010-09-22 16:05:58 -05:00
Matt Mackall
bf9417da11 tests: exit 0 no longer needed on unified tests 2010-09-17 17:03:04 -05:00
Matt Mackall
08439e0f2d tests: add exit codes to unified tests 2010-09-16 17:51:32 -05:00
Martin Geisler
ef593ac2ea test-subrepo-paths: use printf instead of echo
Different shells have different opinions on how to backslashes must be
escaped for echo, but printf is consistent across zsh, dash, bash,
tcsh, and csh.
2010-08-19 16:34:12 +02:00
Martin Geisler
9c87025d80 subrepos: handle backslashes in subpaths 2010-08-19 13:25:46 +02:00
Martin Geisler
e46d654194 test-subrepo-paths: moved comment lines to where they belong 2010-08-18 11:59:35 +02:00
Martin Geisler
ddb79b6591 tests: unify test-subrepo-paths 2010-08-17 16:52:42 +02:00