[PATCH] test-fncache: test reserved / long paths

Adrian Buehlmann adrian at cadifra.com
Wed Sep 26 02:25:21 CDT 2012


FWIW, this patch would have caught the bug done in 7840d81a80ec (which I
fixed with 1a42f19ad958).

Test coverage for hashed paths would IMHO considerably be improved with
this patch. Which seems quite important to me, given how much churn on
the path encoding code front we did recently.

The unit testing done in test-hybridencode.py is certainly helpful, but
I think we also need a couple of real usage patterns.

On 2012-09-19 23:52, Adrian Buehlmann wrote:
> # HG changeset patch
> # User Adrian Buehlmann <adrian at cadifra.com>
> # Date 1348079600 -7200
> # Node ID 52c6e706ada75fd6e4f2aae54a260e1f6afdc82d
> # Parent  331d611813eca2098fdb75c741cb7f5cc72b6567
> test-fncache: test reserved / long paths
> 
> testing the store path encoding with real files
> 
> diff --git a/tests/test-fncache.t b/tests/test-fncache.t
> --- a/tests/test-fncache.t
> +++ b/tests/test-fncache.t
> @@ -117,3 +117,43 @@
>    .hg/undo.dirstate
>    $ cd ..
>  
> +#if no-windows
> +
> +Encoding of reserved / long paths in the store
> +
> +  $ hg init r2
> +  $ cd r2
> +  $ cat <<EOF > .hg/hgrc
> +  > [ui]
> +  > portablefilenames = ignore
> +  > EOF
> +
> +  $ DIR="bla.aux/prn/PRN/lpt/com3/nul/coma/foo.NUL"
> +  $ mkdir -p "$DIR"
> +  $ echo foo > "$DIR/normal.c"
> +  $ DIR="AUX/SECOND/X.PRN/FOURTH/FI:FTH/SIXTH/SEVENTH/EIGHTH/NINETH/TENTH/ELEVENTH"
> +  $ mkdir -p "$DIR"
> +  $ echo foo > "$DIR/LOREMIPSUM.TXT"
> +  $ DIR="enterprise/openesbaddons/contrib-imola/corba-bc/netbeansplugin/wsdlExtension/src/main/java/META-INF/services"
> +  $ mkdir -p "$DIR"
> +  $ echo foo > "$DIR/org.netbeans.modules.xml.wsdl.bindingsupport.spi.ExtensibilityElementTemplateProvider"
> +  $ DIR="Project Planning/Resources/AnotherLongDirectoryName/Followedbyanother/AndAnother"
> +  $ mkdir -p "$DIR"
> +  $ echo foo > "$DIR/AndThenAnExtremelyLongFileName.txt"
> +  $ DIR="12345678/12345678/12345678/12345678/12345678/12345678/12345678/12345"
> +  $ mkdir -p "$DIR"
> +  $ echo foo > "$DIR/xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-123456789-12.3456789-12345-ABCDEFGHIJKLMNOPRSTUVWXYZ-abcdefghjiklmnopqrstuvwxyz"
> +  $ hg ci -qAm1
> +  $ find .hg/store -name *.i  | sort
> +  .hg/store/00changelog.i
> +  .hg/store/00manifest.i
> +  .hg/store/data/bla.aux/pr~6e/_p_r_n/lpt/co~6d3/nu~6c/coma/foo._n_u_l/normal.c.i
> +  .hg/store/dh/12345678/12345678/12345678/12345678/12345678/12345678/12345678/12345/xxxxxx168e07b38e65eff86ab579afaaa8e30bfbe0f35f.i
> +  .hg/store/dh/au~78/second/x.prn/fourth/fi~3afth/sixth/seventh/eighth/nineth/tenth/loremia20419e358ddff1bf8751e38288aff1d7c32ec05.i
> +  .hg/store/dh/enterpri/openesba/contrib-/corba-bc/netbeans/wsdlexte/src/main/java/org.net7018f27961fdf338a598a40c4683429e7ffb9743.i
> +  .hg/store/dh/project_/resource/anotherl/followed/andanoth/andthenanextremelylongfilename0d8e1f4187c650e2f1fdca9fd90f786bc0976b6b.i
> +
> +  $ cd ..
> +
> +#endif
> +



More information about the Mercurial-devel mailing list