hslua-module-text 0.1.2 → 0.1.2.1
raw patch · 3 files changed
+37/−1 lines, 3 filesdep ~basePVP ok
version bump matches the API change (PVP)
Dependency ranges changed: base
API changes (from Hackage documentation)
Files
- ChangeLog.md +6/−0
- hslua-module-text.cabal +2/−1
- test/hstext-test.lua +29/−0
ChangeLog.md view
@@ -1,5 +1,11 @@ # Revision history for hslua-module-text +## 0.1.2.1 -- 2017-11-24++- Add missing test file in the sources archive. This oversight had+ caused some stackage test failures.++ ## 0.1.2 -- 2017-11-17 - Run tests with Travis CI.
hslua-module-text.cabal view
@@ -1,5 +1,5 @@ name: hslua-module-text-version: 0.1.2+version: 0.1.2.1 synopsis: Lua module for text description: UTF-8 aware subset of Lua's `string` module. homepage: https://github.com/hslua/hslua-module-test@@ -11,6 +11,7 @@ category: Foreign build-type: Simple extra-source-files: ChangeLog.md+ test/hstext-test.lua cabal-version: >=1.10 source-repository head
+ test/hstext-test.lua view
@@ -0,0 +1,29 @@+--+-- Tests for the hstext module+--+local hstext = require 'hstext'++assert(hstext.lower 'YELLING' == 'yelling')+assert(hstext.upper 'silence' == 'SILENCE')+assert(hstext.len 'five' == 4)++-- Test UTF-8+assert(hstext.upper 'Lübeck' == 'LÜBECK')+assert(hstext.upper 'Spaß' == 'SPASS')++assert(hstext.len 'Straße' == 6)+assert(hstext.len 'Charité' == 7)+assert(hstext.len '☃' == 1)++assert(hstext.reverse 'être' == 'ertê')+assert(hstext.reverse 'être' == 'ertê')++local hw = 'Hello, World'+assert(string.sub(hw, 6) == hstext.sub(hw, 6))+assert(string.sub(hw, -1, -1) == hstext.sub(hw, -1, -1))+assert(string.sub(hw, -7, -2) == hstext.sub(hw, -7, -2))+assert(string.sub(hw, 7, -2) == hstext.sub(hw, 7, -2))+assert(string.sub(hw, 1, 5) == hstext.sub(hw, 1, 5))+assert(string.sub(hw, 5, 0) == hstext.sub(hw, 5, 0))+assert(string.sub(hw, 0, 2) == hstext.sub(hw, 0, 2))+assert(string.sub(hw, -19, 5) == hstext.sub(hw, -19, 5))