38 lines
778 B
Ruby
38 lines
778 B
Ruby
# $Id$
|
|
#
|
|
#
|
|
|
|
require 'test/unit'
|
|
|
|
$:.unshift "lib"
|
|
|
|
require 'net/ldap'
|
|
|
|
|
|
class TestFilter < Test::Unit::TestCase
|
|
|
|
def setup
|
|
end
|
|
|
|
|
|
def teardown
|
|
end
|
|
|
|
def test_rfc_2254
|
|
p Net::LDAP::Filter.from_rfc2254( " ( uid=george* ) " )
|
|
p Net::LDAP::Filter.from_rfc2254( "uid!=george*" )
|
|
p Net::LDAP::Filter.from_rfc2254( "uid<george*" )
|
|
p Net::LDAP::Filter.from_rfc2254( "uid <= george*" )
|
|
p Net::LDAP::Filter.from_rfc2254( "uid>george*" )
|
|
p Net::LDAP::Filter.from_rfc2254( "uid>=george*" )
|
|
p Net::LDAP::Filter.from_rfc2254( "uid!=george*" )
|
|
|
|
p Net::LDAP::Filter.from_rfc2254( "(& (uid!=george* ) (mail=*))" )
|
|
p Net::LDAP::Filter.from_rfc2254( "(| (uid!=george* ) (mail=*))" )
|
|
p Net::LDAP::Filter.from_rfc2254( "(! (mail=*))" )
|
|
end
|
|
|
|
|
|
end
|
|
|