import sys

import pytest
from clarabot_nano_common.utility.path.validate import is_relative_directive

DISAGREED_ = [". ", " .", " . ", " . .", " . . ", " . . . ", ".. ", " ..", " .. ", " .. .", "...", "... "]


def test_utility_path_validate_is_relative_directive_universal():
    assert is_relative_directive("") is True
    assert is_relative_directive(".") is True
    assert is_relative_directive("..") is True


@pytest.mark.skipif(sys.platform.startswith("win"), reason="for posix only")
def test_utility_path_validate_is_relative_directive_posix():
    for p in DISAGREED_:
        assert is_relative_directive(p) is False


@pytest.mark.skipif(not sys.platform.startswith("win"), reason="for windows only")
def test_utility_path_validate_is_relative_directive_nt():
    for p in DISAGREED_:
        assert is_relative_directive(p) is True
