summaryrefslogtreecommitdiffstats
path: root/src/login/test-login-shared.c
blob: 17cd479dc914a7d6ef0811617532d34fa11c4624 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/* SPDX-License-Identifier: LGPL-2.1-or-later */

#include "login-util.h"
#include "macro.h"
#include "tests.h"

TEST(session_id_valid) {
        assert_se(session_id_valid("c1"));
        assert_se(session_id_valid("1234"));

        assert_se(!session_id_valid("1-2"));
        assert_se(!session_id_valid(""));
        assert_se(!session_id_valid("\tid"));
}

DEFINE_TEST_MAIN(LOG_INFO);