Skip to content

Commit

Permalink
test: ensure markers in snapshot data does not break fossil
Browse files Browse the repository at this point in the history
  • Loading branch information
iamogbz committed May 31, 2021
1 parent d1b515c commit 3c560c3
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,15 @@ set({
set({
})
# ---
# name: test_snapshot_markers
'# '
# ---
# name: test_snapshot_markers.1
'# ---'
# ---
# name: test_snapshot_markers.2
'# name:'
# ---
# name: test_string[0]
''
# ---
Expand Down
8 changes: 8 additions & 0 deletions tests/syrupy/extensions/amber/test_amber_serializer.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

import pytest

from syrupy.extensions.amber.serializer import DataSerializer


def test_non_snapshots(snapshot):
with pytest.raises(AssertionError):
Expand All @@ -17,6 +19,12 @@ def test_empty_snapshot(snapshot):
assert snapshot == ""


def test_snapshot_markers(snapshot):
assert snapshot == DataSerializer._marker_comment
assert snapshot == DataSerializer._marker_divider
assert snapshot == DataSerializer._marker_name


def test_newline_control_characters(snapshot):
assert snapshot == "line 1\nline 2"
assert snapshot == "line 1\r\nline 2"
Expand Down

0 comments on commit 3c560c3

Please sign in to comment.