Skip to content
This repository has been archived by the owner on Aug 29, 2023. It is now read-only.

Commit

Permalink
add same file twice to checck if id is diffrent
Browse files Browse the repository at this point in the history
  • Loading branch information
Monirzadeh committed Sep 14, 2023
1 parent 47464dc commit e57fc62
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion epub_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -850,9 +850,10 @@ func TestManifestItems(t *testing.T) {

testImageFromURLSource := server.URL + "/gophercolor16x16.png"
testManifestItems := []string{
`id="id18a490af-f1fc-5ee4-a449-5c80f646a659" href="images/image0003.png" media-type="image/png"></item>`,
`id="id5857b58e-9d4f-5b23-ad10-d2644bb66023" href="images/filename with space.png" media-type="image/png"></item>`,
`id="id72c19376-e8fb-584c-9dbe-abc447874747" href="images/testfromfile.png" media-type="image/png"></item>`,
`id="id971cabb4-8f27-530a-b2fc-24044798f8a7" href="images/image0005.png" media-type="image/png"></item>`,
`id="ide10ba9f7-2ca1-5db1-8b0c-cbdf809c8372" href="images/image0006.png" media-type="image/png"></item>`,
`id="ide5dc5e63-8586-5ff2-94d9-037b0543ac24" href="images/gophercolor16x16.png" media-type="image/png"></item>`,
`id="idfbc147f0-b6fd-5f0f-9d96-69f1c80e2ec6" href="images/01filenametest.png" media-type="image/png"></item>`,
`id="nav" href="nav.xhtml" media-type="application/xhtml+xml" properties="nav"></item>`,
Expand All @@ -871,6 +872,11 @@ func TestManifestItems(t *testing.T) {
t.Error(err)
}

_, err = e.AddImage(testImageFromFileSource, "")
if err != nil {
t.Error(err)
}

// In particular, we want to test these next two, which will be modified by fixXMLId()
_, err = e.AddImage(testImageFromFileSource, testNumberFilenameStart)
if err != nil {
Expand Down

0 comments on commit e57fc62

Please sign in to comment.