-
Notifications
You must be signed in to change notification settings - Fork 0
Add empty folder export, folder comments, and / escaping #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 2 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
1dd2999
Add empty folder export, folder comments, and / escaping in folder names
AndrianBdn 838cf8f
Address PR review feedback from satvik007
AndrianBdn 3fb7958
Rename TestCase.Folder to FolderPath for clarity
AndrianBdn 154675b
Fix gofumpt formatting
AndrianBdn 517bf59
Add build-examples step to Makefile and CI
AndrianBdn File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,3 +13,6 @@ | |
|
|
||
| # .env files | ||
| .env | ||
|
|
||
| # Generated CSV files | ||
| *.csv | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,143 @@ | ||
| package main | ||
|
|
||
| import ( | ||
| "log" | ||
|
|
||
| qascsv "github.com/hypersequent/qasphere-csv" | ||
| ) | ||
|
|
||
| func main() { | ||
| if err := generateFolderComments(); err != nil { | ||
| log.Fatal(err) | ||
| } | ||
| if err := generateEmptyFolders(); err != nil { | ||
| log.Fatal(err) | ||
| } | ||
| if err := generateEscaping(); err != nil { | ||
| log.Fatal(err) | ||
| } | ||
| } | ||
|
|
||
| func generateFolderComments() error { | ||
| q := qascsv.NewQASphereCSV() | ||
|
|
||
| if err := q.AddFolder(qascsv.Folder{ | ||
| FolderPath: []string{"Commented Folder"}, | ||
| Comment: "This folder has a comment but also contains test cases", | ||
| }); err != nil { | ||
| return err | ||
| } | ||
| if err := q.AddTestCase(qascsv.TestCase{ | ||
| Title: "Test inside commented folder", | ||
| Folder: []string{"Commented Folder"}, | ||
| Priority: qascsv.PriorityHigh, | ||
| }); err != nil { | ||
| return err | ||
| } | ||
|
|
||
| if err := q.AddFolder(qascsv.Folder{ | ||
| FolderPath: []string{"Another Folder"}, | ||
| Comment: "Standalone comment on a folder with no test cases", | ||
| }); err != nil { | ||
| return err | ||
| } | ||
|
|
||
| if err := q.AddFolder(qascsv.Folder{ | ||
| FolderPath: []string{"Parent", "Child With Comment"}, | ||
| Comment: "Nested folder comment", | ||
| }); err != nil { | ||
| return err | ||
| } | ||
| if err := q.AddTestCase(qascsv.TestCase{ | ||
| Title: "Test in parent folder", | ||
| Folder: []string{"Parent"}, | ||
| Priority: qascsv.PriorityMedium, | ||
| }); err != nil { | ||
| return err | ||
| } | ||
|
|
||
| if err := q.WriteCSVToFile("folder_comments.csv"); err != nil { | ||
| return err | ||
| } | ||
| log.Println("wrote folder_comments.csv") | ||
| return nil | ||
| } | ||
|
|
||
| func generateEmptyFolders() error { | ||
| q := qascsv.NewQASphereCSV() | ||
|
|
||
| if err := q.AddFolder(qascsv.Folder{ | ||
| FolderPath: []string{"Empty Root Folder"}, | ||
| }); err != nil { | ||
| return err | ||
| } | ||
| if err := q.AddFolder(qascsv.Folder{ | ||
| FolderPath: []string{"Parent", "Empty Child"}, | ||
| }); err != nil { | ||
| return err | ||
| } | ||
| if err := q.AddFolder(qascsv.Folder{ | ||
| FolderPath: []string{"Parent", "Another Empty Child"}, | ||
| }); err != nil { | ||
| return err | ||
| } | ||
| if err := q.AddTestCase(qascsv.TestCase{ | ||
| Title: "Test in parent alongside empty children", | ||
| Folder: []string{"Parent"}, | ||
| Priority: qascsv.PriorityLow, | ||
| }); err != nil { | ||
| return err | ||
| } | ||
|
|
||
| if err := q.AddFolder(qascsv.Folder{ | ||
| FolderPath: []string{"Deep", "Nested", "Empty"}, | ||
| }); err != nil { | ||
| return err | ||
| } | ||
|
|
||
| if err := q.WriteCSVToFile("empty_folders.csv"); err != nil { | ||
| return err | ||
| } | ||
| log.Println("wrote empty_folders.csv") | ||
| return nil | ||
| } | ||
|
|
||
| func generateEscaping() error { | ||
| q := qascsv.NewQASphereCSV() | ||
|
|
||
| if err := q.AddTestCase(qascsv.TestCase{ | ||
| Title: "Test in folder with slash", | ||
| Folder: []string{"Features/Bugs", "Login"}, | ||
| Priority: qascsv.PriorityHigh, | ||
| }); err != nil { | ||
| return err | ||
| } | ||
| if err := q.AddTestCase(qascsv.TestCase{ | ||
| Title: "Test in folder with multiple slashes", | ||
| Folder: []string{"A/B/C", "D/E"}, | ||
| Priority: qascsv.PriorityMedium, | ||
| }); err != nil { | ||
| return err | ||
| } | ||
|
|
||
| if err := q.AddFolder(qascsv.Folder{ | ||
| FolderPath: []string{"Empty/Slash/Folder"}, | ||
| Comment: "This empty folder name contains slashes", | ||
| }); err != nil { | ||
| return err | ||
| } | ||
|
|
||
| if err := q.AddTestCase(qascsv.TestCase{ | ||
| Title: "Test in normal folder for comparison", | ||
| Folder: []string{"Normal Folder", "Subfolder"}, | ||
| Priority: qascsv.PriorityLow, | ||
| }); err != nil { | ||
| return err | ||
| } | ||
|
|
||
| if err := q.WriteCSVToFile("escaping.csv"); err != nil { | ||
| return err | ||
| } | ||
| log.Println("wrote escaping.csv") | ||
| return nil | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.