#!/bin/sh # # Copyright (c) 2006 Carl D. Worth # global test_description := ''git ls-files test for --error-unmatch option This test runs git ls-files --error-unmatch to ensure it correctly returns an error when a non-existent path is provided on the command line. '' source ./test-lib.sh test_expect_success 'setup' ' touch foo bar && git update-index --add foo bar && git commit -m "add foo bar" ' test_expect_success \ 'git ls-files --error-unmatch should fail with unmatched path.' \ 'test_must_fail git ls-files --error-unmatch foo bar-does-not-match' test_expect_success \ 'git ls-files --error-unmatch should succeed with matched paths.' \ 'git ls-files --error-unmatch foo bar' test_done (CommandList children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:test_description) op: Equal rhs: { (SQ <"git ls-files test for --error-unmatch option\n"> <"\n"> <"This test runs git ls-files --error-unmatch to ensure it correctly\n"> <"returns an error when a non-existent path is provided on the command\n"> <"line.\n"> ) } spids: [13] ) ] spids: [13] ) (C {(.)} {(./test-lib.sh)}) (C {(test_expect_success)} {(SQ )} { (SQ <"\n"> <"\ttouch foo bar &&\n"> <"\tgit update-index --add foo bar &&\n"> <"\tgit commit -m \"add foo bar\"\n"> ) } ) (C {(test_expect_success)} {(SQ <"git ls-files --error-unmatch should fail with unmatched path.">)} {(SQ <"test_must_fail git ls-files --error-unmatch foo bar-does-not-match">)} ) (C {(test_expect_success)} {(SQ <"git ls-files --error-unmatch should succeed with matched paths.">)} {(SQ <"git ls-files --error-unmatch foo bar">)} ) (C {(test_done)}) ] )