From 58472c2103b34612edca15e4cd437b1c77bc5f0c Mon Sep 17 00:00:00 2001 From: Andy Date: Mon, 18 May 2020 22:46:34 -0700 Subject: [PATCH 1/2] Primary Arch package version always equals 1 [Packager] * BUG: Primary Arch package version always equals 1 --- app/src/gambas3/.src/Packager/Package.module | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/gambas3/.src/Packager/Package.module b/app/src/gambas3/.src/Packager/Package.module index a6d99d5fa..cf9e533aa 100644 --- a/app/src/gambas3/.src/Packager/Package.module +++ b/app/src/gambas3/.src/Packager/Package.module @@ -2409,7 +2409,7 @@ Private Function MakeArchPackage(sSys As String) Print #hFile, "_realname="; $sName Print #hFile, "pkgdesc=\"" & sPkgDesc & "\"" Print #hFile, "pkgver=" & $sVersion - Print #hFile, "pkgrel=1" + Print #hFile, "pkgrel="; Project.PackageVersion Print #hFile, "arch=('any')" Print #hFile, "url=\"" & Project.Url & "\"" If Me.ChangeLog Then @@ -2500,7 +2500,7 @@ Private Function MakeArchPackage(sSys As String) Endif Next - RunCommand("cp " & sPackageName & "-" & $sVersion & "-1*.tar.* " & Shell$(Path) &/ "", sBuildDir) + RunCommand("cp " & sPackageName & "-" & $sVersion & "-" & CStr(Project.PackageVersion) & "*.tar.* " & Shell$(Path) &/ "", sBuildDir) ' Remove build dir Shell "rm -rf " & Shell(sBuildDir) Wait From 23e297cead35807c4f3695bc2d78e01c94053ace Mon Sep 17 00:00:00 2001 From: Christof Thalhofer Date: Wed, 27 May 2020 21:22:45 +0200 Subject: [PATCH 2/2] gb.markdown a couple of tests for common problems [GB.MARKDOWN] * NEW: a couple of tests for common problems --- comp/src/gb.markdown/.src/TMarkdown.test | 424 +++++++++++++++++++++++ comp/src/gb.markdown/.test | 9 + 2 files changed, 433 insertions(+) create mode 100644 comp/src/gb.markdown/.src/TMarkdown.test create mode 100644 comp/src/gb.markdown/.test diff --git a/comp/src/gb.markdown/.src/TMarkdown.test b/comp/src/gb.markdown/.src/TMarkdown.test new file mode 100644 index 000000000..3838cf405 --- /dev/null +++ b/comp/src/gb.markdown/.src/TMarkdown.test @@ -0,0 +1,424 @@ +' Gambas test file + +Public Sub TestParagraph() + + Dim md, expect, got As String + + md = "blah" & gb.lf & gb.lf & "blub" & gb.lf & gb.lf & "dingdong" + expect = "

blah

" & gb.lf & "

blub

" & gb.lf & "

dingdong

" + got = Markdown.ToHTML(md) + Assert.Equals(got, expect, "Markdown paragraph") + +End + +Public Sub TestParagraphTwo() + + Dim md, expect, got As String + + md = "blah" & gb.lf & gb.lf & "blub" & gb.lf & "dingdong" + expect = "

blah

" & gb.lf & "

blub" & gb.lf & "dingdong

" + got = Markdown.ToHTML(md) + Assert.Equals(got, expect, "Markdown paragraph Two") + +End + +Public Sub TestParagraphThree() + + Dim md, expect, got As String + + md = "blah" & gb.lf & gb.lf & "blub" + expect = "

blah

" & gb.lf & "

blub

" + got = Markdown.ToHTML(md) + Assert.Equals(got, expect, "Markdown paragraph Three") + 'Assert.Note("I got:" & gb.lf & got) + +End + +Public Sub TestHeadline() + + Dim md, expect, got As String + + md = "# dingdong midhl endhl" + expect = "

dingdong midhl endhl

" + got = Markdown.ToHTML(md) + Assert.Equals(got, expect, "Markdown headline 1-1") + 'Assert.Note("I got:" & gb.lf & got) + + md = "# dingdong midhl endhl #" + expect = "

dingdong midhl endhl

" + got = Markdown.ToHTML(md) + Assert.Equals(got, expect, "Markdown headline 1-2 alternative") + 'Assert.Note("I got:" & gb.lf & got) + + md = "## dingdong midhl endhl" + expect = "

dingdong midhl endhl

" + got = Markdown.ToHTML(md) + Assert.Equals(got, expect, "Markdown headline 2") + 'Assert.Note("I got:" & gb.lf & got) + + md = "### dingdong midhl endhl" + expect = "

dingdong midhl endhl

" + got = Markdown.ToHTML(md) + Assert.Equals(got, expect, "Markdown headline 3") + 'Assert.Note("I got:" & gb.lf & got) + + md = "#### dingdong midhl endhl" + expect = "

dingdong midhl endhl

" + got = Markdown.ToHTML(md) + Assert.Equals(got, expect, "Markdown headline 4") + 'Assert.Note("I got:" & gb.lf & got) + + md = "##### dingdong midhl endhl" + expect = "
dingdong midhl endhl
" + got = Markdown.ToHTML(md) + Assert.Equals(got, expect, "Markdown headline 5") + 'Assert.Note("I got:" & gb.lf & got) + + md = "###### dingdong midhl endhl" + expect = "
dingdong midhl endhl
" + got = Markdown.ToHTML(md) + Assert.Equals(got, expect, "Markdown headline 6") + 'Assert.Note("I got:" & gb.lf & got) + +End + +Public Sub TestHeadlineThree() + + Dim md, got As String + + md = "#dingdong" + Try got = Markdown.ToHTML(md) + Assert.Todo() + Assert.Error("Markdown headline error") + 'Assert.Note("I got:" & gb.lf & got) + +End + +Public Sub TestHlAndParagraph() + + Dim md, expect, got As String + + md = "# headline" & gb.lf & gb.lf & "blub" + expect = "

headline

" & gb.lf & "

blub

" + got = Markdown.ToHTML(md) + Assert.Equals(got, expect, "Markdown headline and paragraph") + +End + +Public Sub TestHlAndLineAndParagraph() + + Dim md, expect, got As String + + md = "# headline" & gb.lf & "---" & gb.lf & "blub" + expect = "

headline

" & gb.lf & "
" & gb.lf & "

blub

" + got = Markdown.ToHTML(md) + Assert.Todo() + Assert.Equals(got, expect, "Markdown headline and paragraph") + ' Assert.Note("I got:" & gb.lf & got) + +End + +Public Sub TestHtmlTagIntegrity() + + Dim md, expect, got As String + + md = "# headline" & gb.lf & gb.lf & "blub" & gb.lf & gb.lf & + "" + + expect = "

headline

" & gb.lf & + "

blub

" & gb.lf & + "" + + got = Markdown.ToHTML(md) + Assert.Todo() + Assert.Equals(got, expect, "Markdown TestHtmlTagIntegrity") + 'Assert.Note("I got:" & gb.lf & got) + +End + +Public Sub TestHtmlTagIntegrityTwo() + + Dim md, expect, got As String + + md = "
" & gb.lf & + "test" & gb.lf & + "anothersth" & gb.lf & + "anothersth and so on." & gb.lf & + "
" + + expect = "
" & gb.lf & + "

test" & gb.lf & + "anothersth" & gb.lf & + "anothersth and so on.

" & gb.lf & + "
" + + got = Markdown.ToHTML(md) + Assert.Todo() + Assert.Equals(got, expect, "Markdown headline and paragraph") + 'Assert.Note("I got:" & gb.lf & got) + +End + +Public Sub TestUL() + + Dim md, expect, got As String + + md = "* One" & gb.lf & + "* Two" & gb.Lf & + "* Three" + + expect = "" + + got = Markdown.ToHTML(md) + Assert.Todo() + Assert.Equals(got, expect, "Markdown UL") + ' Assert.Note("I got:" & gb.lf & got) + +End + +Public Sub TestOL() + + Dim md, expect, got As String + + md = "1. One" & gb.lf & + "1. Two" & gb.Lf & + "1. Three" + + expect = "
    " & gb.Lf & + "
  1. " & gb.Lf & + " One" & gb.Lf & + "
  2. " & gb.Lf & + "
  3. " & gb.Lf & + " Two" & gb.Lf & + "
  4. " & gb.Lf & + "
  5. " & gb.Lf & + " Three" & gb.Lf & + "
  6. " & gb.Lf & + "
" + + got = Markdown.ToHTML(md) + Assert.Todo() + Assert.Equals(got, expect, "Markdown OL") + +End + +Public Sub TestOLWithImage() + + Dim md, expect, got As String + + md = "1. One" & gb.lf & + "1. " & gb.Lf & + "1. Three" + + expect = "
    " & gb.Lf & + "
  1. " & gb.Lf & + " One" & gb.Lf & + "
  2. " & gb.Lf & + "
  3. " & gb.Lf & + " " & gb.Lf & + "
  4. " & gb.Lf & + "
  5. " & gb.Lf & + " Three" & gb.Lf & + "
  6. " & gb.Lf & + "
" + + got = Markdown.ToHTML(md) + Assert.Todo() + Assert.Equals(got, expect, "Markdown OL with image") + ' Assert.Note("I expected:" & gb.lf & expect) + 'Assert.Note("I got:" & gb.lf & got) + +End + +Public Sub TestHtmlTags() + + Dim md, expect, got As String + + md = "" + + expect = "" + + got = Markdown.ToHTML(md) + Assert.Todo() + Assert.Equals(got, expect, "Markdown image") + + ' Assert.Note("I expected:" & gb.lf & expect) + 'Assert.Note("I got:" & gb.lf & got) + +End + +Public Sub TestTable() + + Dim md, expect, got As String + + md = "" & gb.Lf & + "" & gb.Lf & + "" & gb.Lf & + "" & gb.Lf & + "" & gb.Lf & + "" & gb.Lf & + "" & gb.Lf & + "" & gb.Lf & + "" & gb.Lf & + "
" & gb.Lf & + "Bis kg" & + "" & gb.Lf & + "Versandpreis" & + "
" & gb.Lf & + "1,6 kg" & + "" & gb.Lf & + "4,50 €" & + "
" + + expect = "" & gb.Lf & + "" & gb.Lf & + "" & gb.Lf & + "" & gb.Lf & + "" & gb.Lf & + "" & gb.Lf & + "" & gb.Lf & + "" & gb.Lf & + "" & gb.Lf & + "
" & gb.Lf & + "Bis kg" & + "" & gb.Lf & + "Versandpreis" & + "
" & gb.Lf & + "1,6 kg" & + "" & gb.Lf & + "4,50 €" & + "
" + + got = Markdown.ToHTML(md) + Assert.Todo() + Assert.Equals(got, expect, "Markdown preserve table") + 'Assert.Note(got) + +End + +Public Sub TestParInTable() + + Dim md, expect, got As String + + md = "" & gb.Lf & + "" & gb.Lf & + "" & gb.Lf & + "" & gb.Lf & + "" & gb.Lf & + "" & gb.Lf & + "" & gb.Lf & + "" & gb.Lf & + "" & gb.Lf & + "
" & gb.Lf & + "

Bis kg

" & + "
" & gb.Lf & + "Versandpreis" & + "
" & gb.Lf & + "1,6 kg" & + "" & gb.Lf & + "4,50 €" & + "
" + + expect = "" & gb.Lf & + "" & gb.Lf & + "" & gb.Lf & + "" & gb.Lf & + "" & gb.Lf & + "" & gb.Lf & + "" & gb.Lf & + "" & gb.Lf & + "" & gb.Lf & + "
" & gb.Lf & + "

Bis kg

" & + "
" & gb.Lf & + "Versandpreis" & + "
" & gb.Lf & + "1,6 kg" & + "" & gb.Lf & + "4,50 €" & + "
" + + got = Markdown.ToHTML(md) + Assert.Todo() + Assert.Equals(got, expect, "Markdown preserve p in table") + 'Assert.Note(got) + +End + +Public Sub TestPreserverUL() + + Dim md, expect, got As String + + md = "" + + expect = "" + + got = Markdown.ToHTML(md) + Assert.Todo() + Assert.Equals(got, expect, "Markdown preserve ul") + 'Assert.Note(got) + +End + +Public Sub TestPreserverOL() + + Dim md, expect, got As String + + md = "
    " & gb.Lf & + "
  1. First li
  2. " & gb.Lf & + "
  3. Second li
  4. " & gb.Lf & + "
  5. Third li
  6. " & gb.Lf & + "
  7. Fourth li
  8. " & gb.Lf & + "
  9. Mambo no five
  10. " & gb.Lf & + "
" + + expect = "
    " & gb.Lf & + Trim("
  1. First li
  2. ") & gb.Lf & + Trim("
  3. Second li
  4. ") & gb.Lf & + Trim("
  5. Third li
  6. ") & gb.Lf & + Trim("
  7. Fourth li
  8. ") & gb.Lf & + Trim("
  9. Mambo no five
  10. ") & gb.Lf & + "
" + + got = Markdown.ToHTML(md) + Assert.Todo() + Assert.Equals(got, expect, "Markdown preserve ol") + 'Assert.Note(got) + +End + +Public Sub TestStrong() + + Dim md, expect, got As String + + md = "Das berühmte Deganius Kräuterabo" & gb.lf & gb.Lf & "Balb" + expect = "

Das berühmte Deganius Kräuterabo

" & gb.lf & "

Balb

" + got = Markdown.ToHTML(md) + + If Assert.Equals(got, expect, "Markdown strong paragraph") = False Then + Test.Note(got) + Endif + +End diff --git a/comp/src/gb.markdown/.test b/comp/src/gb.markdown/.test new file mode 100644 index 000000000..f1a053492 --- /dev/null +++ b/comp/src/gb.markdown/.test @@ -0,0 +1,9 @@ +[TestSuites] +Count=1 +TestWith=1 +Default="TMarkdown.TestHeadline;TestHeadlineThree;TestHlAndLineAndParagraph;TestHlAndParagraph;TestHtmlTagIntegrity;TestHtmlTagIntegrityTwo;TestHtmlTags;TestOL;TestOLWithImage;TestParInTable;TestParagraph;TestParagraphThree;TestParagraphTwo;TestPreserverOL;TestPreserverUL;TestStrong;TestTable;TestUL" + +[TestSuites/1] +Name="OL" +Tests="TMarkdown.TestOL" +