Skip to content

Commit

Permalink
Path normalized on Windows\?
Browse files Browse the repository at this point in the history
  • Loading branch information
ggrossetie committed Jul 8, 2023
1 parent 304edf9 commit c145bca
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions test/preprocess.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -261,23 +261,21 @@ ${includedText}`
})

it('should throw an error for local file(s) referenced multiple times with "!include_once local-file-or-url"', () => {
const localExistingFilePathNormalized = path.normalize(localExistingFilePath)
const diagramTextWithExistingLocalIncludeOneFile = `
!include_once ${localExistingFilePath}
alice -> bob
!include_once ${localExistingFilePath}`
const errorMessage = `Preprocessing of PlantUML include failed, because including multiple times referenced file '${localExistingFilePathNormalized}' with '!include_once' guard`
const errorMessage = `Preprocessing of PlantUML include failed, because including multiple times referenced file '${localExistingFilePath}' with '!include_once' guard`
expect(() => preprocessPlantUML(diagramTextWithExistingLocalIncludeOneFile, {})).to.throw(errorMessage)
})

it('should throw an error for local file(s) referenced multiple times nested with "!include_once local-file-or-url"', () => {
const localExistingFileNameIncldudeOncePath = 'test/fixtures/plantuml/styles/style-include-once-general.iuml'
const localExistingFilePathNormalized = path.normalize(localExistingFilePath)
const diagramTextWithExistingLocalIncludeOneFile = `
!include_once ${localExistingFilePath}
alice -> bob
!include ${localExistingFileNameIncldudeOncePath}`
const errorMessage = `Preprocessing of PlantUML include failed, because including multiple times referenced file '${localExistingFilePathNormalized}' with '!include_once' guard`
const errorMessage = `Preprocessing of PlantUML include failed, because including multiple times referenced file '${localExistingFilePath}' with '!include_once' guard`
expect(() => preprocessPlantUML(diagramTextWithExistingLocalIncludeOneFile, {})).to.throw(errorMessage)
})

Expand Down

0 comments on commit c145bca

Please sign in to comment.