diff options
author | ned <ned@appliedtrust.com> | 2014-11-23 20:03:05 +0100 |
---|---|---|
committer | ned <ned@appliedtrust.com> | 2014-11-23 20:03:05 +0100 |
commit | c43d537d5bb0eeb491153b00cdefcb54a6178187 (patch) | |
tree | 45187fde4a720d3f53d13ec45ac4fea8e27356e4 /filter_test.go | |
parent | LDAP server support (diff) | |
download | ldap-c43d537d5bb0eeb491153b00cdefcb54a6178187.tar ldap-c43d537d5bb0eeb491153b00cdefcb54a6178187.tar.gz ldap-c43d537d5bb0eeb491153b00cdefcb54a6178187.tar.bz2 ldap-c43d537d5bb0eeb491153b00cdefcb54a6178187.tar.lz ldap-c43d537d5bb0eeb491153b00cdefcb54a6178187.tar.xz ldap-c43d537d5bb0eeb491153b00cdefcb54a6178187.tar.zst ldap-c43d537d5bb0eeb491153b00cdefcb54a6178187.zip |
Diffstat (limited to 'filter_test.go')
-rw-r--r-- | filter_test.go | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/filter_test.go b/filter_test.go index fb54905..2e62f25 100644 --- a/filter_test.go +++ b/filter_test.go @@ -111,3 +111,27 @@ func BenchmarkFilterDecompile(b *testing.B) { DecompileFilter(filters[i%maxIdx]) } } + +func TestGetFilterObjectClass(t *testing.T) { + c, err := GetFilterObjectClass("(objectClass=*)") + if err != nil { + t.Errorf("GetFilterObjectClass failed") + } + if c != "" { + t.Errorf("GetFilterObjectClass failed") + } + c, err = GetFilterObjectClass("(objectClass=posixAccount)") + if err != nil { + t.Errorf("GetFilterObjectClass failed") + } + if c != "posixaccount" { + t.Errorf("GetFilterObjectClass failed") + } + c, err = GetFilterObjectClass("(&(cn=awesome)(objectClass=posixGroup))") + if err != nil { + t.Errorf("GetFilterObjectClass failed") + } + if c != "posixgroup" { + t.Errorf("GetFilterObjectClass failed") + } +} |