Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

701 B
Raw Blame
package bigquery

import (
	"testing"

	"github.com/stretchr/testify/require"
)

func TestEncodeOperatorEmail(t *testing.T) {
	tests := []struct {
		email string
		want  string
	}{
		{
			"[email protected]",
			"hello_bb_com",
		},
		{
			"[email protected]",
			"hello123_bb_com",
		},
		{
			"0123456789012345678901234567890123456789012345678901234567890123456789",
			"012345678901234567890123456789012345678901234567890123456789012",
		},
		{
			"012345678901234567890123456789012345678901234567890123456789012",
			"012345678901234567890123456789012345678901234567890123456789012",
		},
	}

	for _, test := range tests {
		got := encodeOperatorEmail(test.email)
		require.Equal(t, test.want, got)
	}
}