-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Viewing members work, but lacks information - Remove features from schema that won't be used - Code reorganization - HTML/CSS updates to be more unified - I miss gerrit Signed-off-by: Ian Meyer <[email protected]>
- Loading branch information
Showing
21 changed files
with
1,312 additions
and
957 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
This file contains 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,37 @@ | ||
package main | ||
|
||
import ( | ||
"testing" | ||
) | ||
|
||
func TestParseID(t *testing.T) { | ||
tests := []struct { | ||
name string | ||
path string | ||
want int64 | ||
wantErr bool | ||
}{ | ||
{"Valid thread ID", "/thread/1263", 1263, false}, | ||
{"Valid member ID", "/member/23", 23, false}, | ||
{"Invalid member path", "/member/abc", 0, true}, | ||
{"Invalid thread path", "/thread/abc", 0, true}, | ||
{"Empty path", "", 0, true}, | ||
{"Missing thread ID", "/thread/", 0, true}, | ||
{"Missing member ID", "/member/", 0, true}, | ||
{"Extra thread characters", "/thread/123/extra", 0, true}, | ||
{"Extra member characters", "/member/123/extra", 0, true}, | ||
} | ||
|
||
for _, tt := range tests { | ||
t.Run(tt.name, func(t *testing.T) { | ||
got, err := parseID(tt.path) | ||
if (err != nil) != tt.wantErr { | ||
t.Errorf("parseID() error = %v, wantErr %v", err, tt.wantErr) | ||
return | ||
} | ||
if got != tt.want { | ||
t.Errorf("parseID() = %v, want %v", got, tt.want) | ||
} | ||
}) | ||
} | ||
} |
Oops, something went wrong.