Add tests for multiple execs
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by Thayne McCombs · committed by David Peter · parent 9fb0c5d · Browse files · 1 file·+76 added−0 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
1 file+76 added−0 removed
- tests:+76 added−0 removed
Provenance
- Commit
9f39f1d- Tree
c5811aa- Author
Thayne McCombs <astrothayne@gmail.com>- Committer
David Peter <sharkdp@users.noreply.github.com>- Parent
9fb0c5d
1 file changed+76 added−0 removed
modified:tests/tests.rs+76 added
1382 unmodified lines1383 }1384 }1385 1386 #[test]1387+fn test_exec_multi() {1388+ // TODO test for windows1389+ if cfg!(windows) {1390+ return;1391+ }1392+ let (te, abs_path) = get_test_env_with_abs_path(DEFAULT_DIRS, DEFAULT_FILES);1393+1394+ te.assert_output(1395+ &[1396+ "--absolute-path",1397+ "foo",1398+ "--exec",1399+ "echo",1400+ ";",1401+ "--exec",1402+ "echo",1403+ "test",1404+ "{/}",1405+ ],1406+ &format!(1407+ "{abs_path}/a.foo1408+ {abs_path}/one/b.foo1409+ {abs_path}/one/two/C.Foo21410+ {abs_path}/one/two/c.foo1411+ {abs_path}/one/two/three/d.foo1412+ {abs_path}/one/two/three/directory_foo1413+ test a.foo1414+ test b.foo1415+ test C.Foo21416+ test c.foo1417+ test d.foo1418+ test directory_foo",1419+ abs_path = &abs_path1420+ ),1421+ );1422+1423+ te.assert_output(1424+ &[1425+ "e1", "--exec", "echo", "{.}", ";", "--exec", "echo", "{/}", ";", "--exec", "echo",1426+ "{//}", ";", "--exec", "echo", "{/.}",1427+ ],1428+ "e1 e21429+ e1 e21430+ .1431+ e1 e2",1432+ );1433+1434+ te.assert_output(1435+ &[1436+ "foo", "--exec", "echo", "-n", "{/}: ", ";", "--exec", "echo", "{//}",1437+ ],1438+ "a.foo: .1439+ b.foo: ./one1440+ C.Foo2: ./one/two1441+ c.foo: ./one/two1442+ d.foo: ./one/two/three1443+ directory_foo: ./one/two/three",1444+ );1445+}1446+1447+#[test]1448 fn test_exec_batch() {1449 let (te, abs_path) = get_test_env_with_abs_path(DEFAULT_DIRS, DEFAULT_FILES);1450 let te = te.normalize_line(true);1451 44 unmodified lines1496 }1497 }1498 1499 #[test]1500+fn test_exec_batch_multi() {1501+ // TODO test for windows1502+ if cfg!(windows) {1503+ return;1504+ }1505+ let te = TestEnv::new(DEFAULT_DIRS, DEFAULT_FILES);1506+1507+ te.assert_output(1508+ &["foo", "--exec-batch", "echo", "{}", ";", "--exec-batch", "echo", "{/}"],1509+ "./a.foo ./one/b.foo ./one/two/C.Foo2 ./one/two/c.foo ./one/two/three/d.foo ./one/two/three/directory_foo1510+ a.foo b.foo C.Foo2 c.foo d.foo directory_foo",1511+ );1512+}1513+1514+#[test]1515 fn test_exec_batch_with_limit() {1516 // TODO Test for windows1517 if cfg!(windows) {1518 return;576 unmodified lines