From f09d617005d48eecd04dda1d887e1d378c3acd90 Mon Sep 17 00:00:00 2001 From: steve donovan Date: Mon, 20 Jun 2016 18:50:07 +0200 Subject: [PATCH] always write output with lf line endings --- ldoc/tools.lua | 5 ++++- run-tests.lua | 6 ++++++ tests/one.md | 11 +++++++++++ 3 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 run-tests.lua create mode 100644 tests/one.md diff --git a/ldoc/tools.lua b/ldoc/tools.lua index 54528d2..d311f70 100644 --- a/ldoc/tools.lua +++ b/ldoc/tools.lua @@ -242,8 +242,11 @@ function M.check_file (f,original) end function M.writefile(name,text) - local ok,err = utils.writefile(name,text) + local f,err = io.open(name,"wb") +--~ local ok,err = utils.writefile(name,text) if err then quit(err) end + f:write(text) + f:close() end function M.name_of (lpath) diff --git a/run-tests.lua b/run-tests.lua new file mode 100644 index 0000000..335659a --- /dev/null +++ b/run-tests.lua @@ -0,0 +1,6 @@ +function run_test(dir) + os.execute('cd '..dir..' && ldoc --testing . && diff -r doc cdocs') +end +run_test('tests') +run_test('tests/example') +run_test('tests/md-test') diff --git a/tests/one.md b/tests/one.md new file mode 100644 index 0000000..2e263a4 --- /dev/null +++ b/tests/one.md @@ -0,0 +1,11 @@ +# Documentation + +## types + +A reference to @{types.first} + +A `first` topic + +## classes + +A `second` topic