(ctx context.Context, t *testctx.T)
| 682 | } |
| 683 | |
| 684 | func (ShellSuite) TestArgsSpread(ctx context.Context, t *testctx.T) { |
| 685 | c := connect(ctx, t) |
| 686 | modGen := daggerCliBase(t, c) |
| 687 | |
| 688 | for _, tc := range []struct { |
| 689 | command string |
| 690 | expected string |
| 691 | }{ |
| 692 | { |
| 693 | command: `with-exec echo hello world | stdout`, |
| 694 | expected: "hello world\n", |
| 695 | }, |
| 696 | { |
| 697 | command: `with-exec echo with tail options --redirect-stdout /out | file /out | contents`, |
| 698 | expected: "with tail options\n", |
| 699 | }, |
| 700 | { |
| 701 | command: `with-exec --redirect-stdout /out echo with head options | file /out | contents`, |
| 702 | expected: "with head options\n", |
| 703 | }, |
| 704 | { |
| 705 | command: `with-exec --stdin "with interspersed args" cat --redirect-stdout /out | file /out | contents`, |
| 706 | expected: "with interspersed args", |
| 707 | }, |
| 708 | { |
| 709 | command: `with-exec --redirect-stdout /out -- echo -n stop processing flags: --expand | file /out | contents`, |
| 710 | expected: "stop processing flags: --expand", |
| 711 | }, |
| 712 | { |
| 713 | command: `with-env-variable MSG "with double" | with-exec --redirect-stdout /out --expand -- echo -n \$MSG --expand | file /out | contents`, |
| 714 | expected: "with double --expand", |
| 715 | }, |
| 716 | { |
| 717 | command: `with-exec --redirect-stdout /out -- echo -n git checkout -- file | file /out | contents`, |
| 718 | expected: "git checkout -- file", |
| 719 | }, |
| 720 | { |
| 721 | command: `with-exec -- sh -c 'echo hello something,with,commas' | stdout`, |
| 722 | expected: "hello something,with,commas\n", |
| 723 | }, |
| 724 | { |
| 725 | command: `with-exec -- sh -c 'echo "with double quotes"' | stdout`, |
| 726 | expected: "with double quotes\n", |
| 727 | }, |
| 728 | { |
| 729 | command: `with-exec -- sh -c "echo 'with single quotes'" | stdout`, |
| 730 | expected: "with single quotes\n", |
| 731 | }, |
| 732 | { |
| 733 | command: `with-exec -- sh -c "echo $(directory | with-new-file foo "with state" | file foo | contents)" | stdout`, |
| 734 | expected: "with state\n", |
| 735 | }, |
| 736 | { |
| 737 | command: `with-exec echo,with,csv,support | stdout`, |
| 738 | expected: "with csv support\n", |
| 739 | }, |
| 740 | } { |
| 741 | t.Run(strings.TrimSpace(tc.expected), func(ctx context.Context, t *testctx.T) { |
nothing calls this directly
no test coverage detected