Skip to content

Commit

Permalink
Add test for PPM with comment
Browse files Browse the repository at this point in the history
  • Loading branch information
valeriyvan committed May 14, 2024
1 parent 6fac56e commit a080ba9
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions Tests/geometrizeTests/BitmapTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,30 @@ final class BitmapTests: XCTestCase {
return XCTFail("Bitmap.ParsePpmError.wrongElement wasn't threw or context isn't as expected")
}
}

assertSnapshot(
matching: try Bitmap(ppmString: """
P3
# "P3" means this is a RGB color image in ASCII
# "3 2" is the width and height of the image in pixels
# "255" is the maximum value for each color
# This, up through the "255" line below are the header.
# Everything after that is the image data: RGB triplets.
# In order: red, green, blue, yellow, white, and black.
# This example is taken from https://en.wikipedia.org/wiki/Netpbm
3 2
255
255 0 0
0 255 0
0 0 255
255 255 0
255 255 255
0 0 0
"""
),
as: SimplySnapshotting(pathExtension: "png", diffing: Diffing<Bitmap>.image)
)

}

func testPpmString() {
Expand Down

0 comments on commit a080ba9

Please sign in to comment.