-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement C Sharp unhandled exceptions in join_template plugin (#762)
* Add c sharp exceptions * Add tests and benchmarks --------- Co-authored-by: george pogosyan <[email protected]>
- Loading branch information
1 parent
1e53729
commit 3d3fb9e
Showing
20 changed files
with
1,520 additions
and
883 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package ascii | ||
|
||
func IsSpace(c byte) bool { | ||
switch c { | ||
case ' ', '\n', '\t': | ||
return true | ||
default: | ||
return false | ||
} | ||
} | ||
|
||
func IsHexDigit(c byte) bool { | ||
return IsDigit(c) || ('a' <= c && c <= 'f') | ||
} | ||
|
||
func IsDigit(c byte) bool { | ||
return '0' <= c && c <= '9' | ||
} | ||
|
||
func IsLetterOrUnderscoreOrDigit(c byte) bool { | ||
return IsLetterOrUnderscore(c) || IsDigit(c) | ||
} | ||
|
||
func IsLetterOrUnderscore(c byte) bool { | ||
return IsLetter(c) || c == '_' | ||
} | ||
|
||
func IsLetter(c byte) bool { | ||
return IsLowerCaseLetter(c) || IsUpperCaseLetter(c) | ||
} | ||
|
||
func IsLowerCaseLetter(c byte) bool { | ||
return 'a' <= c && c <= 'z' | ||
} | ||
|
||
func ToLower(c byte) byte { | ||
if IsUpperCaseLetter(c) { | ||
return c + 'a' - 'A' | ||
} | ||
|
||
return c | ||
} | ||
|
||
func IsUpperCaseLetter(c byte) bool { | ||
return 'A' <= c && c <= 'Z' | ||
} |
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,23 @@ | ||
package ascii | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/stretchr/testify/require" | ||
) | ||
|
||
func TestToLower(t *testing.T) { | ||
f := make([]byte, 1<<8) | ||
for x := range f { | ||
f[x] = byte(x) | ||
} | ||
|
||
f['A'] = 'a' | ||
for x := 'B'; x <= 'Z'; x++ { | ||
f[x] = f[x-1] + 1 | ||
} | ||
|
||
for x := range f { | ||
require.Equal(t, f[x], ToLower(byte(x))) | ||
} | ||
} |
This file was deleted.
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
Oops, something went wrong.