forked from jaime-olivares/vscode-yuml
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
114 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { promises as fs } from "fs"; | ||
import { dirname, join } from "path"; | ||
import { fileURLToPath } from "url"; | ||
|
||
import yuml2svg from "../index.mjs"; | ||
|
||
const __dirname = dirname(fileURLToPath(import.meta.url)); | ||
|
||
const inputDir = join(__dirname, "old_issues"); | ||
|
||
export default fs.readdir(inputDir).then(files => | ||
Promise.all( | ||
files | ||
.filter(filename => filename.endsWith(".yuml")) | ||
.map(filename => join(inputDir, filename)) | ||
.map(path => | ||
Promise.all([ | ||
fs | ||
.readFile(path) | ||
.then(input => yuml2svg(input)) | ||
.then(Buffer.from), | ||
fs.readFile(path + ".svg"), | ||
]).then(([actualOutput, expectedOutput]) => { | ||
if (Buffer.compare(actualOutput, expectedOutput) === 0) { | ||
return Promise.resolve("Success"); | ||
} else { | ||
return Promise.reject("An old bug file as been modified"); | ||
} | ||
}) | ||
) | ||
) | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
// {type:state} | ||
{start}[start]->(你好!) |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
// {type:class} | ||
// {direction:topDown} | ||
[note: You can stick notes on diagrams too!{bg:cornsilk}] | ||
[Customer]<>1-orders 0..*>[Order] | ||
[Order]-[note:asdf] |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.