name = "multi_file_search" category = "filesystem" mode = "solve" description = """ You are given a working directory containing several text files. Read a search pattern (a simple string, not regex) from stdin. Search all .txt files in the working directory for lines containing that pattern (case-sensitive). Print matching results in the format: "filename:line_number:line_content" Results should be sorted first by filename, then by line number. Line numbers are 1-based. """ [[test_cases]] stdin = "error" expected_stdout = """app.txt:2:found an error here app.txt:4:another error occurred system.txt:1:error on startup""" setup_files = { "app.txt" = "all good\nfound an error here\nno problem\nanother error occurred", "system.txt" = "error on startup\nrunning fine\nshutdown", "data.csv" = "error,value\n1,2" } [[test_cases]] stdin = "hello" expected_stdout = """a.txt:1:hello world b.txt:2:say hello""" setup_files = { "a.txt" = "hello world\ngoodbye", "b.txt" = "greetings\nsay hello" } [[test_cases]] stdin = "notfound" expected_stdout = "" setup_files = { "test.txt" = "nothing matches here" }