This is an archive of the discontinued Mercurial Phabricator instance.

test-dispatch: make the test compatible with chg
ClosedPublic

Authored by singhsrb on Oct 16 2017, 7:52 PM.

Details

Summary

The test is broken when run with chg because it prints a different
error message when chg is running. This commit fixes the test by special casing
for chg.

Test Plan

Ran the test 'test-dispatch.t' with and without '--chg' option.

Diff Detail

Repository
rHG Mercurial
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

singhsrb created this revision.Oct 16 2017, 7:52 PM
quark requested changes to this revision.Oct 16 2017, 7:56 PM
quark added a subscriber: quark.

Just a small nit.

tests/test-dispatch.t
72–73

Alternatively, you can use individual line matching without duplicating the hg version line:

abort: error getting current working directory: * (glob) (no-chg !)
chg: abort: failed to getcwd (errno = *) (glob) (chg !)
81

errno and error message could be platform dependent:

chg: ... (errno = *) (glob)
This revision now requires changes to proceed.Oct 16 2017, 7:56 PM
singhsrb added inline comments.Oct 16 2017, 8:10 PM
tests/test-dispatch.t
72–73

That certainly seems like a better approach. Thanks!

81

Hmmm, didn't consider that. Thanks!

singhsrb updated this revision to Diff 2852.Oct 16 2017, 8:15 PM
quark accepted this revision.Oct 16 2017, 8:16 PM
durin42 accepted this revision.Oct 16 2017, 9:32 PM
This revision is now accepted and ready to land.Oct 16 2017, 9:32 PM
This revision was automatically updated to reflect the committed changes.