2015-01-03 22:03:57 +02:00
|
|
|
package authboss
|
|
|
|
|
2017-02-24 02:13:25 +02:00
|
|
|
import "testing"
|
2015-03-04 08:34:37 +02:00
|
|
|
|
2015-01-19 00:35:44 +02:00
|
|
|
func TestCasingStyleConversions(t *testing.T) {
|
2015-02-16 06:07:36 +02:00
|
|
|
t.Parallel()
|
|
|
|
|
2015-03-14 07:09:01 +02:00
|
|
|
tests := []struct {
|
|
|
|
In string
|
|
|
|
Out string
|
|
|
|
}{
|
|
|
|
{"SomethingInCamel", "something_in_camel"},
|
|
|
|
{"Oauth2Anything", "oauth2_anything"},
|
2015-01-19 00:35:44 +02:00
|
|
|
}
|
|
|
|
|
2015-03-14 07:09:01 +02:00
|
|
|
for i, test := range tests {
|
|
|
|
out := camelToUnder(test.In)
|
|
|
|
if out != test.Out {
|
|
|
|
t.Errorf("%d) Expected %q got %q", i, test.Out, out)
|
|
|
|
}
|
|
|
|
out = underToCamel(out)
|
|
|
|
if out != test.In {
|
2015-03-16 23:42:45 +02:00
|
|
|
t.Errorf("%d), Expected %q got %q", i, test.In, out)
|
2015-03-14 07:09:01 +02:00
|
|
|
}
|
2015-01-19 00:35:44 +02:00
|
|
|
}
|
|
|
|
}
|