packages feed

pandoc-lua-marshal 0.1.0 → 0.1.0.1

raw patch · 3 files changed

+70/−1 lines, 3 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

Files

CHANGELOG.md view
@@ -3,6 +3,12 @@ `pandoc-lua-marshal` uses [PVP Versioning][1]. The changelog is available [on GitHub][2]. +## 0.1.0.1++Released 2021-11-28.++* Added test-simpletable.lua to the list of extra-source-files.+ ## 0.1.0  Released 2021-11-28.
pandoc-lua-marshal.cabal view
@@ -1,6 +1,6 @@ cabal-version:       2.4 name:                pandoc-lua-marshal-version:             0.1.0+version:             0.1.0.1 synopsis:            Use pandoc types in Lua description:         This package provides functions to marshal and unmarshal                      pandoc document types to and from Lua.@@ -37,6 +37,7 @@                    , test/test-list.lua                    , test/test-metavalue.lua                    , test/test-pandoc.lua+                   , test/test-simpletable.lua  source-repository head   type:                git
+ test/test-simpletable.lua view
@@ -0,0 +1,62 @@+local tasty = require 'tasty'++local test = tasty.test_case+local group = tasty.test_group+local assert = tasty.assert++local default_caption = {Str 'Languages', Space(), Str 'overview.'}+local default_aligns = {AlignDefault, AlignDefault}+local default_widths = {0, 0}+local default_headers = {{Plain({Str "Language"})}, {Plain({Str "Typing"})}}+local default_rows = {+  {{Plain "Haskell"}, {Plain "static"}},+  {{Plain "Lua"}, {Plain "Dynamic"}},+}++return {+  group 'SimpleTable' {+    test('can access properties', function ()+      local simple_table = SimpleTable(+        default_caption,+        default_aligns,+        default_widths,+        default_headers,+        default_rows+      )+      assert.are_same(simple_table.caption, default_caption)+      assert.are_same(simple_table.aligns, default_aligns)+      assert.are_same(simple_table.widths, default_widths)+      assert.are_same(simple_table.headers, default_headers)+      assert.are_same(simple_table.rows, default_rows)+    end),+    test('can modify properties', function ()+      local new_table = SimpleTable(+        default_caption,+        default_aligns,+        {0.5, 0.5},+        default_headers,+        default_rows+      )++      new_table.caption = {Str 'Good', Space(),+                           Str 'languages'}+      new_table.aligns[1] = AlignLeft+      new_table.widths = {0, 0}+      new_table.headers[2] = {Plain{Str 'compiled/interpreted'}}+      new_table.rows[1][2] = {Plain{Str 'both'}}+      new_table.rows[2][2] = {Plain{Str 'interpreted'}}++      local expected_table = SimpleTable(+        {Str 'Good', Space(), Str 'languages'},+        {AlignLeft, AlignDefault},+        {0, 0},+        {{Plain 'Language'}, {Plain 'compiled/interpreted'}},+        {+          {{Plain 'Haskell'}, {Plain 'both'}},+          {{Plain 'Lua'}, {Plain 'interpreted'}}+        }+      )+      assert.are_same(expected_table, new_table)+    end)+  },+}