21 lines
670 B
Go
21 lines
670 B
Go
package facebook
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestNormalizeEventID(t *testing.T) {
|
|
tests := map[string]string{
|
|
" ": " ",
|
|
"https://www.facebook.com/events/415721506974513": "415721506974513",
|
|
"https://www.facebook.com/events/415721506974513/": "415721506974513",
|
|
"https://www.facebook.com/events/415721506974513/?ref=asdf": "415721506974513",
|
|
"415721506974513/?ref=asdf": "415721506974513",
|
|
"415721506974513": "415721506974513",
|
|
}
|
|
for in, expected := range tests {
|
|
assert.Equal(t, expected, NormalizeEventID(in), in)
|
|
}
|
|
}
|