(t *testing.T)
| 36 | } |
| 37 | |
| 38 | func TestSetOutput(t *testing.T) { |
| 39 | a := assert.New(t) |
| 40 | ctx := context.Background() |
| 41 | rc := new(RunContext) |
| 42 | rc.StepResults = make(map[string]*model.StepResult) |
| 43 | handler := rc.commandHandler(ctx) |
| 44 | |
| 45 | rc.CurrentStep = "my-step" |
| 46 | rc.StepResults[rc.CurrentStep] = &model.StepResult{ |
| 47 | Outputs: make(map[string]string), |
| 48 | } |
| 49 | handler("::set-output name=x::valz\n") |
| 50 | a.Equal("valz", rc.StepResults["my-step"].Outputs["x"]) |
| 51 | |
| 52 | handler("::set-output name=x::percent2%25\n") |
| 53 | a.Equal("percent2%", rc.StepResults["my-step"].Outputs["x"]) |
| 54 | |
| 55 | handler("::set-output name=x::percent2%25%0Atest\n") |
| 56 | a.Equal("percent2%\ntest", rc.StepResults["my-step"].Outputs["x"]) |
| 57 | |
| 58 | handler("::set-output name=x::percent2%25%0Atest another3%25test\n") |
| 59 | a.Equal("percent2%\ntest another3%test", rc.StepResults["my-step"].Outputs["x"]) |
| 60 | |
| 61 | handler("::set-output name=x%3A::percent2%25%0Atest\n") |
| 62 | a.Equal("percent2%\ntest", rc.StepResults["my-step"].Outputs["x:"]) |
| 63 | |
| 64 | handler("::set-output name=x%3A%2C%0A%25%0D%3A::percent2%25%0Atest\n") |
| 65 | a.Equal("percent2%\ntest", rc.StepResults["my-step"].Outputs["x:,\n%\r:"]) |
| 66 | } |
| 67 | |
| 68 | func TestAddpath(t *testing.T) { |
| 69 | a := assert.New(t) |
nothing calls this directly
no test coverage detected
searching dependent graphs…