diff --git a/tests/test_io.py b/tests/test_io.py index 26a032c..09ceb9a 100644 --- a/tests/test_io.py +++ b/tests/test_io.py @@ -118,10 +118,10 @@ def test_bed_writer_write_comment_with_prefix_pound_symbol(tmp_path: Path) -> No writer = BedWriter[Bed2](handle) writer.write_comment("# hello mom!") writer.write(Bed2(refname="chr1", start=1)) - writer.write_comment("# hello dad!") + writer.write_comment("# hello\ndad!") writer.write(Bed2(refname="chr2", start=2)) - expected = "# hello mom!\nchr1\t1\n# hello dad!\nchr2\t2\n" + expected = "# hello mom!\nchr1\t1\n# hello\n# dad!\nchr2\t2\n" assert Path(tmp_path / "test.bed").read_text() == expected @@ -131,7 +131,7 @@ def test_bed_writer_write_comment_without_prefix_pound_symbol(tmp_path: Path) -> writer = BedWriter[Bed2](handle) writer.write_comment("track this-is-fine") writer.write_comment("browser is mario's enemy?") - writer.write_comment("hello mom!") + writer.write_comment("hello\nmom!") writer.write(Bed2(refname="chr1", start=1)) writer.write_comment("hello dad!") writer.write(Bed2(refname="chr2", start=2)) @@ -139,7 +139,8 @@ def test_bed_writer_write_comment_without_prefix_pound_symbol(tmp_path: Path) -> expected = ( "track this-is-fine\n" "browser is mario's enemy?\n" - "# hello mom!\n" + "# hello\n" + "# mom!\n" "chr1\t1\n" "# hello dad!\n" "chr2\t2\n" @@ -206,7 +207,7 @@ def test_bed_reader_can_read_bed_records_with_comments(tmp_path: Path) -> None: with open(tmp_path / "test.bed", "w") as handle: writer: BedWriter = BedWriter(handle) - writer.write_comment("track this-is-fine") + writer.write_comment("track\nthis-is-fine") writer.write_comment("browser is mario's enemy?") writer.write_comment("hello mom!") handle.write("\n") # empty line