<commit_before>#
# Copyright (C) 2011, 2012 <NAME> <<EMAIL>>
# License: MIT
#
import anyconfig.parser as P

import os
import os.path
import sys
import tempfile
import unittest


class Test_parser(unittest.TestCase):

    def test_00_parse_single(self):
        self.assertEquals(P.parse_single(""), "")
        self.assertEquals(P.parse_single("0"), 0)
        self.assertEquals(P.parse_single("123"), 123)
        self.assertEquals(P.parse_single("True"), True)
        self.assertEquals(P.parse_single("a string"), "a string")
        self.assertEquals(P.parse_single("0.1"), "0.1")
        self.assertEquals(
            P.parse_single("    a string contains extra whitespaces     "),
            "a string contains extra whitespaces"
        )

    def test_01_parse_list(self):
        self.assertEquals(P.parse_list(""), [])
        self.assertEquals(P.parse_list("a,b"), ["a", "b"])
        self.assertEquals(P.parse_list("1,2"), [1, 2])
        self.assertEquals(P.parse_list("a,b,"), ["a", "b"])
        self.assertEquals(P.parse_list("a|b|", "|"), ["a", "b"])

    def test_02_parse_attrlist_0(self):
        self.assertEquals(
            P.parse_attrlist_0("requires:bash,zsh"),
            [('requires', ['bash', 'zsh'])]
        )
        self.assertEquals(
            P.parse_attrlist_0("obsoletes:sysdata;conflicts:sysdata-old"),
            [('obsoletes', ['sysdata']), ('conflicts', ['sysdata-old'])]
        )

    def test_03_parse(self):
        pass


# vim:sw=4:ts=4:et:<commit_msg>added some more test cases to check some previous changes in anyconfig.parser<commit_after>#
# Copyright (C) 2011, 2012 <NAME>OH <<EMAIL>>
# License: MIT
#
import anyconfig.parser as P

import os
import os.path
import sys
import tempfile
import unittest


class Test_parser(unittest.TestCase):

    def test_00_parse_single(self):
        self.assertEquals(P.parse_single(""), "")
        self.assertEquals(P.parse_single("0"), 0)
        self.assertEquals(P.parse_single("123"), 123)
        self.assertEquals(P.parse_single("True"), True)
        self.assertEquals(P.parse_single("a string"), "a string")
        self.assertEquals(P.parse_single("0.1"), "0.1")
        self.assertEquals(
            P.parse_single("    a string contains extra whitespaces     "),
            "a string contains extra whitespaces"
        )

    def test_01_parse_list(self):
        self.assertEquals(P.parse_list(""), [])
        self.assertEquals(P.parse_list("a,b"), ["a", "b"])
        self.assertEquals(P.parse_list("1,2"), [1, 2])
        self.assertEquals(P.parse_list("a,b,"), ["a", "b"])
        self.assertEquals(P.parse_list("a|b|", "|"), ["a", "b"])

    def test_02_parse_attrlist_0(self):
        self.assertEquals(
            P.parse_attrlist_0("requires:bash,zsh"),
            [('requires', ['bash', 'zsh'])]
        )
        self.assertEquals(
            P.parse_attrlist_0("obsoletes:sysdata;conflicts:sysdata-old"),
            [('obsoletes', 'sysdata'), ('conflicts', 'sysdata-old')]
        )

    def test_03_parse(self):
        pass


# vim:sw=4:ts=4:et:
{'fraction_non_alphanumeric': 0.16558230318802863, 'fraction_numerical': 0.024072869225764477, 'mean_word_length': 3.0091264667535853, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7025554', 'n_tokens_mistral': 1062, 'n_tokens_neox': 992, 'n_words': 178}