<commit_before>"""
Test case sensitivity of paths on Windows / POSIX
llvm.org/pr22667
"""

import os
import lldb
from lldbsuite.test.lldbtest import *
from lldbsuite.test.decorators import *
from lldbsuite.test import lldbplatform, lldbplatformutil

class BreakpointCaseSensitivityTestCase(TestBase):
    mydir = TestBase.compute_mydir(__file__)
    BREAKPOINT_TEXT = 'Set a breakpoint here'

    def setUp(self):
        # Call super's setUp().
        TestBase.setUp(self)
        self.line = line_number('main.c', self.BREAKPOINT_TEXT)

    @skipIf(oslist=no_match(['windows']))  # Skip for non-windows platforms
    def test_breakpoint_matches_file_with_different_case(self):
        """Set breakpoint on file, should match files with different case on Windows"""
        self.build()
        self.case_sensitivity_breakpoint(True)

    @skipIf(oslist=['windows']) # Skip for windows platforms
    def test_breakpoint_doesnt_match_file_with_different_case(self):
        """Set breakpoint on file, shouldn't match files with different case on POSIX systems"""
        self.build()
        self.case_sensitivity_breakpoint(False)

    def case_sensitivity_breakpoint(self, case_insensitive):
        """Set breakpoint on file, should match files with different case if case_insensitive is True"""
        
        # use different case to check CreateTarget
        exe = 'a.out'
        if case_insensitive:
            exe = exe.upper()
            
        exe = os.path.join(os.getcwd(), exe)

        # Create a target by the debugger.
        self.target = self.dbg.CreateTarget(exe)
        self.assertTrue(self.target, VALID_TARGET)
        cwd = self.get_process_working_directory();
                
        # try both BreakpointCreateByLocation and BreakpointCreateBySourceRegex
        for regex in [False, True]:
            # should always hit
            self.check_breakpoint('main.c', regex, True)
            # should always hit
            self.check_breakpoint(os.path.join(cwd, 'main.c'), regex, True)
            # different case for directory<commit_msg>xfail case sensitivity test on Linux.<commit_after>"""
Test case sensitivity of paths on Windows / POSIX
llvm.org/pr22667
"""

import os
import lldb
from lldbsuite.test.lldbtest import *
from lldbsuite.test.decorators import *
from lldbsuite.test import lldbplatform, lldbplatformutil

class BreakpointCaseSensitivityTestCase(TestBase):
    mydir = TestBase.compute_mydir(__file__)
    BREAKPOINT_TEXT = 'Set a breakpoint here'

    def setUp(self):
        # Call super's setUp().
        TestBase.setUp(self)
        self.line = line_number('main.c', self.BREAKPOINT_TEXT)

    @skipIf(oslist=no_match(['windows']))  # Skip for non-windows platforms
    def test_breakpoint_matches_file_with_different_case(self):
        """Set breakpoint on file, should match files with different case on Windows"""
        self.build()
        self.case_sensitivity_breakpoint(True)

    @skipIf(oslist=['windows']) # Skip for windows platforms
    @expectedFailureAll() # Failing for unknown reason on non-Windows platforms.
    def test_breakpoint_doesnt_match_file_with_different_case(self):
        """Set breakpoint on file, shouldn't match files with different case on POSIX systems"""
        self.build()
        self.case_sensitivity_breakpoint(False)

    def case_sensitivity_breakpoint(self, case_insensitive):
        """Set breakpoint on file, should match files with different case if case_insensitive is True"""
        
        # use different case to check CreateTarget
        exe = 'a.out'
        if case_insensitive:
            exe = exe.upper()
            
        exe = os.path.join(os.getcwd(), exe)

        # Create a target by the debugger.
        self.target = self.dbg.CreateTarget(exe)
        self.assertTrue(self.target, VALID_TARGET)
        cwd = self.get_process_working_directory();
                
        # try both BreakpointCreateByLocation and BreakpointCreateBySourceRegex
        for regex in [False, True]:
            # should always hit
            self.check_breakpoint('main.c', regex, True)
            # should always hit
            self.check_breakpoint(os.path.join(cwd, 'main.c'), regex, True)
            # different case for directory
{'fraction_non_alphanumeric': 0.08655876143560873, 'fraction_numerical': 0.002345765892563922, 'mean_word_length': 2.9776119402985075, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '2660134', 'n_tokens_mistral': 1256, 'n_tokens_neox': 1209, 'n_words': 326}