sile 0.15.3

Simon’s Improved Layout Engine
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
SILE = require("core.sile")
SILE.backend = "debug"
SILE.init()

describe("SILE.shapers.base", function ()
   it("should always have positive stretch and shrink", function ()
      SILE.settings:set("shaper.variablespaces", true)
      SILE.settings:set("shaper.spacestretchfactor", 2)
      SILE.settings:set("shaper.spaceshrinkfactor", 2)
      local negative_glue = SILE.types.node.glue("-4pt")
      local space = SILE.shaper:makeSpaceNode({}, negative_glue)
      assert.is.truthy(space.width.stretch > SILE.types.measurement(0))
      assert.is.truthy(space.width.shrink > SILE.types.measurement(0))
   end)
end)