From f0bcba6900ae8fb803a9b5d775a55c68c5870812 Mon Sep 17 00:00:00 2001 From: Saketram Durbha Date: Sat, 22 Aug 2020 02:22:39 -0400 Subject: [PATCH 1/3] follow go style of table-driven tests more closesly --- internal/lifecycle/readme_test.go | 136 ++++++++++++++++-------------- 1 file changed, 72 insertions(+), 64 deletions(-) diff --git a/internal/lifecycle/readme_test.go b/internal/lifecycle/readme_test.go index 2869bf6..263024b 100644 --- a/internal/lifecycle/readme_test.go +++ b/internal/lifecycle/readme_test.go @@ -3,6 +3,7 @@ package lifecycle import ( "bufio" "errors" + "fmt" "os" "os/exec" "reflect" @@ -193,40 +194,42 @@ var toCommandsTests = []toCommandsTest{ func TestToCommands(t *testing.T) { for i, tc := range toCommandsTests { - if len(tc.codeBlock) == 0 { - continue - } + t.Run(fmt.Sprintf("#%d", i), func(t *testing.T) { + if len(tc.codeBlock) == 0 { + return + } - if err := setEnv(tc.env); err != nil { - t.Errorf("#%d: setEnv: %v", i, err) + if err := setEnv(tc.env); err != nil { + t.Errorf("setEnv: %v", err) - if err = unsetEnv(tc.env); err != nil { - t.Errorf("#%d: unsetEnv: %v", i, err) - } + if err = unsetEnv(tc.env); err != nil { + t.Errorf("unsetEnv: %v", err) + } - continue - } + return + } - cmds, err := tc.codeBlock.toCommands(uniqueServiceName, uniqueGCRURL) + cmds, err := tc.codeBlock.toCommands(uniqueServiceName, uniqueGCRURL) - var errorMatch bool - if err == nil { - errorMatch = tc.err == "" - } else { - errorMatch = strings.Contains(err.Error(), tc.err) - } + var errorMatch bool + if err == nil { + errorMatch = tc.err == "" + } else { + errorMatch = strings.Contains(err.Error(), tc.err) + } - if !errorMatch { - t.Errorf("#%d: error mismatch\nwant: %s\ngot: %v", i, tc.err, err) - } + if !errorMatch { + t.Errorf("error mismatch\nwant: %s\ngot: %v", tc.err, err) + } - if (errorMatch && err == nil) && !reflect.DeepEqual(cmds, tc.cmds) { - t.Errorf("#%d: result mismatch\nwant: %#+v\ngot: %#+v", i, tc.cmds, cmds) - } + if (errorMatch && err == nil) && !reflect.DeepEqual(cmds, tc.cmds) { + t.Errorf("result mismatch\nwant: %#+v\ngot: %#+v", tc.cmds, cmds) + } - if err := unsetEnv(tc.env); err != nil { - t.Errorf("#%d: unsetEnv: %v", i, err) - } + if err := unsetEnv(tc.env); err != nil { + t.Errorf("unsetEnv: %v", err) + } + }) } } @@ -250,22 +253,23 @@ var parseREADMETests = []parseREADMETest{ func TestParseREADME(t *testing.T) { for i, tc := range parseREADMETests { - if tc.inFileName == "" { - continue - } + t.Run(fmt.Sprintf("#%d", i), func(t *testing.T) { + if tc.inFileName == "" { + return + } - // Cloud Run Service name and Container Registry URL tag replacement will be tested in TestToCommands - lifecycle, err := parseREADME(tc.inFileName, "", "") + // Cloud Run Service name and Container Registry URL tag replacement will be tested in TestToCommands + lifecycle, err := parseREADME(tc.inFileName, "", "") - if !errors.Is(err, tc.err) { - t.Errorf("#%d: error mismatch\nwant: %v\ngot: %v", i, tc.err, err) - continue - } + if !errors.Is(err, tc.err) { + t.Errorf("error mismatch\nwant: %v\ngot: %v", tc.err, err) + return + } - if err == nil && !reflect.DeepEqual(lifecycle, tc.lifecycle) { - t.Errorf("#%d: result mismatch\nwant: %#+v\ngot: %#+v", i, tc.lifecycle, lifecycle) - continue - } + if err == nil && !reflect.DeepEqual(lifecycle, tc.lifecycle) { + t.Errorf("result mismatch\nwant: %#+v\ngot: %#+v", tc.lifecycle, lifecycle) + } + }) } } @@ -307,23 +311,25 @@ var extractLifecycleTests = []extractLifecycleTest{ func TestExtractLifecycle(t *testing.T) { for i, tc := range extractLifecycleTests { - if tc.in == "" { - continue - } + t.Run(fmt.Sprintf("#%d", i), func(t *testing.T) { + if tc.in == "" { + return + } - s := bufio.NewScanner(strings.NewReader(tc.in)) + s := bufio.NewScanner(strings.NewReader(tc.in)) - // Cloud Run Service name and Container Registry URL tag replacement will be tested in TestToCommands - lifecycle, err := extractLifecycle(s, "", "") + // Cloud Run Service name and Container Registry URL tag replacement will be tested in TestToCommands + lifecycle, err := extractLifecycle(s, "", "") - if !errors.Is(err, tc.err) { - t.Errorf("#%d: error mismatch\nwant: %v\ngot: %v", i, tc.err, err) - continue - } + if !errors.Is(err, tc.err) { + t.Errorf("error mismatch\nwant: %v\ngot: %v", tc.err, err) + return + } - if err == nil && !reflect.DeepEqual(lifecycle, tc.lifecycle) { - t.Errorf("#%d: result mismatch\nwant: %#+v\ngot: %#+v", i, tc.lifecycle, lifecycle) - } + if err == nil && !reflect.DeepEqual(lifecycle, tc.lifecycle) { + t.Errorf("result mismatch\nwant: %#+v\ngot: %#+v", tc.lifecycle, lifecycle) + } + }) } } @@ -439,20 +445,22 @@ var extractCodeBlocksTests = []extractCodeBlocksTest{ func TestExtractCodeBlocks(t *testing.T) { for i, tc := range extractCodeBlocksTests { - if tc.in == "" { - continue - } + t.Run(fmt.Sprintf("#%d", i), func(t *testing.T) { + if tc.in == "" { + return + } - s := bufio.NewScanner(strings.NewReader(tc.in)) - codeBlocks, err := extractCodeBlocks(s) + s := bufio.NewScanner(strings.NewReader(tc.in)) + codeBlocks, err := extractCodeBlocks(s) - if !errors.Is(err, tc.err) { - t.Errorf("#%d: error mismatch\nwant: %v\ngot: %v", i, tc.err, err) - continue - } + if !errors.Is(err, tc.err) { + t.Errorf("error mismatch\nwant: %v\ngot: %v", tc.err, err) + return + } - if err == nil && !reflect.DeepEqual(codeBlocks, tc.codeBlocks) { - t.Errorf("#%d: result mismatch\nwant: %#+v\ngot: %#+v", i, tc.codeBlocks, codeBlocks) - } + if err == nil && !reflect.DeepEqual(codeBlocks, tc.codeBlocks) { + t.Errorf("result mismatch\nwant: %#+v\ngot: %#+v", tc.codeBlocks, codeBlocks) + } + }) } } From bc4e86f6bf9c263d8a6a0d2bcb1c59e2536a02cd Mon Sep 17 00:00:00 2001 From: Saketram Durbha Date: Mon, 24 Aug 2020 17:40:34 -0400 Subject: [PATCH 2/3] add descriptions to tests --- internal/lifecycle/readme_test.go | 127 +++++++++++++----------------- 1 file changed, 55 insertions(+), 72 deletions(-) diff --git a/internal/lifecycle/readme_test.go b/internal/lifecycle/readme_test.go index 263024b..5bcca6e 100644 --- a/internal/lifecycle/readme_test.go +++ b/internal/lifecycle/readme_test.go @@ -39,25 +39,25 @@ const uniqueServiceName = "unique_service_name" const uniqueGCRURL = "gcr.io/unique/tag" type toCommandsTest struct { - codeBlock codeBlock // input code block - cmds []*exec.Cmd // expected result of codeBlock.toCommands - err string // expected string contained in return error of codeBlock.toCommands - env map[string]string // map of environment variables to values for this test + description string // test case description + codeBlock codeBlock // input code block + cmds []*exec.Cmd // expected result of codeBlock.toCommands + err string // expected string contained in return error of codeBlock.toCommands + env map[string]string // map of environment variables to values for this test } var toCommandsTests = []toCommandsTest{ - // single one-line command { + description: "single one-line command test", codeBlock: codeBlock{ "echo hello world", }, cmds: []*exec.Cmd{ - exec.Command("echo", "hello", "world"), + exec.Command("echo", "hello", "wosrld"), }, }, - - // two one-line commands { + description: "two one-line commands test", codeBlock: codeBlock{ "echo line one", "echo line two", @@ -67,9 +67,8 @@ var toCommandsTests = []toCommandsTest{ exec.Command("echo", "line", "two"), }, }, - - // single multiline command { + description: "single multiline command test", codeBlock: codeBlock{ "echo multi \\", "line command", @@ -78,18 +77,16 @@ var toCommandsTests = []toCommandsTest{ exec.Command("echo", "multi", "line", "command"), }, }, - - // line cont char but code block closes at next line { + description: "line cont char but code block closes at next line test", codeBlock: codeBlock{ "echo multi \\", }, cmds: nil, err: errCodeBlockEndAfterLineCont, }, - - // expand environment variable test { + description: "expand environment variable test", codeBlock: codeBlock{ "echo ${TEST_ENV}", }, @@ -100,9 +97,8 @@ var toCommandsTests = []toCommandsTest{ "TEST_ENV": "hello world", }, }, - - // replace Cloud Run service name with provided name test { + description: "replace Cloud Run service name with provided name test", codeBlock: codeBlock{ "gcloud run services deploy hello_world", }, @@ -110,9 +106,8 @@ var toCommandsTests = []toCommandsTest{ exec.Command("gcloud", "--quiet", "run", "services", "deploy", uniqueServiceName), }, }, - - // replace Container Registry URL with provided URL test { + description: "replace Container Registry URL with provided URL test", codeBlock: codeBlock{ "gcloud builds submit --tag=gcr.io/hello/world", }, @@ -120,9 +115,8 @@ var toCommandsTests = []toCommandsTest{ exec.Command("gcloud", "--quiet", "builds", "submit", "--tag="+uniqueGCRURL), }, }, - - // replace multiline GCR URL with provided URL test { + description: "replace multiline GCR URL with provided URL test", codeBlock: codeBlock{ "gcloud builds submit --tag=gcr.io/hello/\\", "world", @@ -131,9 +125,8 @@ var toCommandsTests = []toCommandsTest{ exec.Command("gcloud", "--quiet", "builds", "submit", "--tag="+uniqueGCRURL), }, }, - - // replace Cloud Run service name and GCR URL with provided inputs test { + description: "replace Cloud Run service name and GCR URL with `--image=url` syntax test", codeBlock: codeBlock{ "gcloud run services deploy hello_world --image=gcr.io/hello/world", }, @@ -141,20 +134,17 @@ var toCommandsTests = []toCommandsTest{ exec.Command("gcloud", "--quiet", "run", "services", "deploy", uniqueServiceName, "--image="+uniqueGCRURL), }, }, - - // replace Cloud Run service name and GCR URL with `--image url` syntax test - // this test breaks right now (issue #3) - //{ - // codeBlock: codeBlock{ - // "gcloud run services deploy hello_world --image gcr.io/hello/world", - // }, - // cmds: []*exec.Cmd{ - // exec.Command("gcloud", "--quiet", "run", "services", "deploy", uniqueServiceName, "--image", uniqueGCRURL), - // }, - // serviceName: "unique_service_name", - // gcrURL: "gcr.io/unique/tag", - //}, { + description: "replace Cloud Run service name and GCR URL with `--image url` syntax test", + codeBlock: codeBlock{ + "gcloud run services deploy hello_world --image gcr.io/hello/world", + }, + cmds: []*exec.Cmd{ + exec.Command("gcloud", "--quiet", "run", "services", "deploy", uniqueServiceName, "--image", uniqueGCRURL), + }, + }, + { + description: "replace Cloud Run service name and GCR URL and expand environment variables test", codeBlock: codeBlock{ "gcloud run services deploy hello_world --image=gcr.io/hello/world --add-cloudsql-instances=${TEST_CLOUD_SQL_CONNECTION}", }, @@ -165,9 +155,8 @@ var toCommandsTests = []toCommandsTest{ "TEST_CLOUD_SQL_CONNECTION": "project:region:instance", }, }, - - // replace Cloud Run service name provided name in command with multiline arguments test { + description: "replace Cloud Run service name in command with multiline arguments test", codeBlock: codeBlock{ "gcloud run services update hello_world --add-cloudsql-instances=\\", "project:region:instance", @@ -176,9 +165,8 @@ var toCommandsTests = []toCommandsTest{ exec.Command("gcloud", "--quiet", "run", "services", "update", uniqueServiceName, "--add-cloudsql-instances=project:region:instance"), }, }, - - // replace Cloud Run service name provided name and expand environment variables in command with multiline arguments test { + description: "replace Cloud Run service name and expand environment variables in command with multiline arguments test", codeBlock: codeBlock{ "gcloud run services update hello_world --add-cloudsql-instances=\\", "${TEST_CLOUD_SQL_CONNECTION}", @@ -194,7 +182,7 @@ var toCommandsTests = []toCommandsTest{ func TestToCommands(t *testing.T) { for i, tc := range toCommandsTests { - t.Run(fmt.Sprintf("#%d", i), func(t *testing.T) { + t.Run(fmt.Sprintf("#%d: %s", i, tc.description), func(t *testing.T) { if len(tc.codeBlock) == 0 { return } @@ -234,15 +222,16 @@ func TestToCommands(t *testing.T) { } type parseREADMETest struct { - inFileName string // input Markdown file - lifecycle Lifecycle // expected result of parseREADME - err error // expected parseREADME return error + description string // test case description + inFileName string // input Markdown file + lifecycle Lifecycle // expected result of parseREADME + err error // expected parseREADME return error } var parseREADMETests = []parseREADMETest{ - // three code blocks, only two with comment code tags. one with one command, the other with two commands { - inFileName: "readme_test.md", + description: "three code blocks, only two with comment code tags. one with one command, the other with two commands test", + inFileName: "readme_test.md", lifecycle: Lifecycle{ exec.Command("echo", "hello", "world"), exec.Command("echo", "line", "one"), @@ -253,7 +242,7 @@ var parseREADMETests = []parseREADMETest{ func TestParseREADME(t *testing.T) { for i, tc := range parseREADMETests { - t.Run(fmt.Sprintf("#%d", i), func(t *testing.T) { + t.Run(fmt.Sprintf("#%d: %s", i, tc.description), func(t *testing.T) { if tc.inFileName == "" { return } @@ -274,14 +263,15 @@ func TestParseREADME(t *testing.T) { } type extractLifecycleTest struct { - in string // input Markdown string - lifecycle Lifecycle // expected results of extractLifecycle on in - err error // expected error + description string // test case description + in string // input Markdown string + lifecycle Lifecycle // expected results of extractLifecycle on in + err error // expected error } var extractLifecycleTests = []extractLifecycleTest{ - // single code block { + description: "single code block test", in: "[//]: # ({sst-run-unix})\n" + "```\n" + "echo hello world\n" + @@ -290,9 +280,8 @@ var extractLifecycleTests = []extractLifecycleTest{ exec.Command("echo", "hello", "world"), }, }, - - // two code blocks with markdown text in the middle { + description: "two code blocks with markdown text in the middle test", in: "[//]: # ({sst-run-unix})\n" + "```\n" + "echo build command\n" + @@ -311,7 +300,7 @@ var extractLifecycleTests = []extractLifecycleTest{ func TestExtractLifecycle(t *testing.T) { for i, tc := range extractLifecycleTests { - t.Run(fmt.Sprintf("#%d", i), func(t *testing.T) { + t.Run(fmt.Sprintf("#%d: %s", i, tc.description), func(t *testing.T) { if tc.in == "" { return } @@ -334,14 +323,15 @@ func TestExtractLifecycle(t *testing.T) { } type extractCodeBlocksTest struct { - in string // input Markdown string - codeBlocks []codeBlock // expected result of extractCodeBlocks - err error // expected return error of extractCodeBlocks + description string // test case description + in string // input Markdown string + codeBlocks []codeBlock // expected result of extractCodeBlocks + err error // expected return error of extractCodeBlocks } var extractCodeBlocksTests = []extractCodeBlocksTest{ - // single code block { + description: "single code block test", in: "[//]: # ({sst-run-unix})\n" + "```\n" + "echo hello world\n" + @@ -352,18 +342,16 @@ var extractCodeBlocksTests = []extractCodeBlocksTest{ }, }, }, - - // code block not closed { + description: "code block not closed test", in: "[//]: # ({sst-run-unix})\n" + "```\n" + "echo hello world\n", codeBlocks: nil, err: errCodeBlockNotClosed, }, - - // code block doesn't start immediately after code tag { + description: "code block doesn't start immediately after code tag test", in: "[//]: # ({sst-run-unix})\n" + "not start of code block\n" + "```\n" + @@ -372,17 +360,15 @@ var extractCodeBlocksTests = []extractCodeBlocksTest{ codeBlocks: nil, err: errCodeBlockStartNotFound, }, - - // EOF immediately after code tag { + description: "EOF immediately after code tag test", in: "instuctions\n" + "[//]: # ({sst-run-unix})\n", codeBlocks: nil, err: errEOFAfterCodeTag, }, - - // single code block, two lines { + description: "single code block, two lines test", in: "[//]: # ({sst-run-unix})\n" + "```\n" + "echo line one\n" + @@ -395,9 +381,8 @@ var extractCodeBlocksTests = []extractCodeBlocksTest{ }, }, }, - - // two code blocks with markdown instructions in the middle { + description: "two code blocks with markdown instructions in the middle test", in: "[//]: # ({sst-run-unix})\n" + "```\n" + "echo build command\n" + @@ -416,9 +401,8 @@ var extractCodeBlocksTests = []extractCodeBlocksTest{ }, }, }, - - // two code blocks, but only one is annotated with code tag { + description: "two code blocks, but only one is annotated with code tag test", in: "[//]: # ({sst-run-unix})\n" + "```\n" + "echo build and deploy command\n" + @@ -433,9 +417,8 @@ var extractCodeBlocksTests = []extractCodeBlocksTest{ }, }, }, - - // one code block, but not annotated with code tag { + description: "one code block, but not annotated with code tag test", in: "```\n" + "echo hello world\n" + "```\n", @@ -445,7 +428,7 @@ var extractCodeBlocksTests = []extractCodeBlocksTest{ func TestExtractCodeBlocks(t *testing.T) { for i, tc := range extractCodeBlocksTests { - t.Run(fmt.Sprintf("#%d", i), func(t *testing.T) { + t.Run(fmt.Sprintf("#%d: %s", i, tc.description), func(t *testing.T) { if tc.in == "" { return } From 89a7c50ac883a15e49019399757d2f4b50f795fe Mon Sep 17 00:00:00 2001 From: Saketram Durbha Date: Wed, 2 Sep 2020 04:38:03 -0400 Subject: [PATCH 3/3] update readme tests description format and fix typo --- internal/lifecycle/readme_test.go | 50 +++++++++++++++---------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/internal/lifecycle/readme_test.go b/internal/lifecycle/readme_test.go index 5bcca6e..444dd1e 100644 --- a/internal/lifecycle/readme_test.go +++ b/internal/lifecycle/readme_test.go @@ -48,16 +48,16 @@ type toCommandsTest struct { var toCommandsTests = []toCommandsTest{ { - description: "single one-line command test", + description: "single one-line command", codeBlock: codeBlock{ "echo hello world", }, cmds: []*exec.Cmd{ - exec.Command("echo", "hello", "wosrld"), + exec.Command("echo", "hello", "world"), }, }, { - description: "two one-line commands test", + description: "two one-line commands", codeBlock: codeBlock{ "echo line one", "echo line two", @@ -68,7 +68,7 @@ var toCommandsTests = []toCommandsTest{ }, }, { - description: "single multiline command test", + description: "single multiline command", codeBlock: codeBlock{ "echo multi \\", "line command", @@ -78,7 +78,7 @@ var toCommandsTests = []toCommandsTest{ }, }, { - description: "line cont char but code block closes at next line test", + description: "line cont char but code block closes at next line", codeBlock: codeBlock{ "echo multi \\", }, @@ -86,7 +86,7 @@ var toCommandsTests = []toCommandsTest{ err: errCodeBlockEndAfterLineCont, }, { - description: "expand environment variable test", + description: "expand environment variable", codeBlock: codeBlock{ "echo ${TEST_ENV}", }, @@ -98,7 +98,7 @@ var toCommandsTests = []toCommandsTest{ }, }, { - description: "replace Cloud Run service name with provided name test", + description: "replace Cloud Run service name with provided name", codeBlock: codeBlock{ "gcloud run services deploy hello_world", }, @@ -107,7 +107,7 @@ var toCommandsTests = []toCommandsTest{ }, }, { - description: "replace Container Registry URL with provided URL test", + description: "replace Container Registry URL with provided URL", codeBlock: codeBlock{ "gcloud builds submit --tag=gcr.io/hello/world", }, @@ -116,7 +116,7 @@ var toCommandsTests = []toCommandsTest{ }, }, { - description: "replace multiline GCR URL with provided URL test", + description: "replace multiline GCR URL with provided URL", codeBlock: codeBlock{ "gcloud builds submit --tag=gcr.io/hello/\\", "world", @@ -126,7 +126,7 @@ var toCommandsTests = []toCommandsTest{ }, }, { - description: "replace Cloud Run service name and GCR URL with `--image=url` syntax test", + description: "replace Cloud Run service name and GCR URL with `--image=url` syntax", codeBlock: codeBlock{ "gcloud run services deploy hello_world --image=gcr.io/hello/world", }, @@ -135,7 +135,7 @@ var toCommandsTests = []toCommandsTest{ }, }, { - description: "replace Cloud Run service name and GCR URL with `--image url` syntax test", + description: "replace Cloud Run service name and GCR URL with `--image url` syntax", codeBlock: codeBlock{ "gcloud run services deploy hello_world --image gcr.io/hello/world", }, @@ -144,7 +144,7 @@ var toCommandsTests = []toCommandsTest{ }, }, { - description: "replace Cloud Run service name and GCR URL and expand environment variables test", + description: "replace Cloud Run service name and GCR URL and expand environment variables", codeBlock: codeBlock{ "gcloud run services deploy hello_world --image=gcr.io/hello/world --add-cloudsql-instances=${TEST_CLOUD_SQL_CONNECTION}", }, @@ -156,7 +156,7 @@ var toCommandsTests = []toCommandsTest{ }, }, { - description: "replace Cloud Run service name in command with multiline arguments test", + description: "replace Cloud Run service name in command with multiline arguments", codeBlock: codeBlock{ "gcloud run services update hello_world --add-cloudsql-instances=\\", "project:region:instance", @@ -166,7 +166,7 @@ var toCommandsTests = []toCommandsTest{ }, }, { - description: "replace Cloud Run service name and expand environment variables in command with multiline arguments test", + description: "replace Cloud Run service name and expand environment variables in command with multiline arguments", codeBlock: codeBlock{ "gcloud run services update hello_world --add-cloudsql-instances=\\", "${TEST_CLOUD_SQL_CONNECTION}", @@ -230,7 +230,7 @@ type parseREADMETest struct { var parseREADMETests = []parseREADMETest{ { - description: "three code blocks, only two with comment code tags. one with one command, the other with two commands test", + description: "three code blocks, only two with comment code tags. one with one command, the other with two commands", inFileName: "readme_test.md", lifecycle: Lifecycle{ exec.Command("echo", "hello", "world"), @@ -271,7 +271,7 @@ type extractLifecycleTest struct { var extractLifecycleTests = []extractLifecycleTest{ { - description: "single code block test", + description: "single code block", in: "[//]: # ({sst-run-unix})\n" + "```\n" + "echo hello world\n" + @@ -281,7 +281,7 @@ var extractLifecycleTests = []extractLifecycleTest{ }, }, { - description: "two code blocks with markdown text in the middle test", + description: "two code blocks with markdown text in the middle", in: "[//]: # ({sst-run-unix})\n" + "```\n" + "echo build command\n" + @@ -331,7 +331,7 @@ type extractCodeBlocksTest struct { var extractCodeBlocksTests = []extractCodeBlocksTest{ { - description: "single code block test", + description: "single code block", in: "[//]: # ({sst-run-unix})\n" + "```\n" + "echo hello world\n" + @@ -343,7 +343,7 @@ var extractCodeBlocksTests = []extractCodeBlocksTest{ }, }, { - description: "code block not closed test", + description: "code block not closed", in: "[//]: # ({sst-run-unix})\n" + "```\n" + "echo hello world\n", @@ -351,7 +351,7 @@ var extractCodeBlocksTests = []extractCodeBlocksTest{ err: errCodeBlockNotClosed, }, { - description: "code block doesn't start immediately after code tag test", + description: "code block doesn't start immediately after code tag", in: "[//]: # ({sst-run-unix})\n" + "not start of code block\n" + "```\n" + @@ -361,14 +361,14 @@ var extractCodeBlocksTests = []extractCodeBlocksTest{ err: errCodeBlockStartNotFound, }, { - description: "EOF immediately after code tag test", + description: "EOF immediately after code tag", in: "instuctions\n" + "[//]: # ({sst-run-unix})\n", codeBlocks: nil, err: errEOFAfterCodeTag, }, { - description: "single code block, two lines test", + description: "single code block, two lines", in: "[//]: # ({sst-run-unix})\n" + "```\n" + "echo line one\n" + @@ -382,7 +382,7 @@ var extractCodeBlocksTests = []extractCodeBlocksTest{ }, }, { - description: "two code blocks with markdown instructions in the middle test", + description: "two code blocks with markdown instructions in the middle", in: "[//]: # ({sst-run-unix})\n" + "```\n" + "echo build command\n" + @@ -402,7 +402,7 @@ var extractCodeBlocksTests = []extractCodeBlocksTest{ }, }, { - description: "two code blocks, but only one is annotated with code tag test", + description: "two code blocks, but only one is annotated with code tag", in: "[//]: # ({sst-run-unix})\n" + "```\n" + "echo build and deploy command\n" + @@ -418,7 +418,7 @@ var extractCodeBlocksTests = []extractCodeBlocksTest{ }, }, { - description: "one code block, but not annotated with code tag test", + description: "one code block, but not annotated with code tag", in: "```\n" + "echo hello world\n" + "```\n",