• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

starwing / luautf8 / 19302506971
99%

Build:
DEFAULT BRANCH: master
Ran 12 Nov 2025 03:23PM UTC
Jobs 5
Files 1
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

12 Nov 2025 03:22PM UTC coverage: 99.026%. Remained the same
19302506971

push

github

starwing
feat!: add widthlimit API and modernize width functions (v0.2.0)

BREAKING CHANGES:
- `utf8.width()` and `utf8.widthindex()` now use integer `ambiwidth`
  parameter instead of boolean `ambi_is_double`
- New optional byte range parameters `i, j` added before `ambiwidth`

New Features:
- Add `utf8.widthlimit(s, i, j[, limit[, ambiwidth[, default]]])`
  - Unified function for width measurement and truncation
  - Positive limit: truncate from front (keep prefix)
  - Negative limit: truncate from back (keep suffix)
  - Omit limit: measure display width of byte range [i, j]
  - Returns: (pos, remain) where pos is truncation point or j if measuring
- Add `utf8.version` constant (set to "0.2.0")

API Changes:
- `utf8.width(s[, i[, j[, ambiwidth[, default]]]])`
  - Old: `utf8.width(s[, ambi_is_double[, default]])`
  - New: `ambi_is_double` (boolean) → `ambiwidth` (integer 1 or 2)
  - New: Optional byte range parameters `i, j` for substring width

- `utf8.widthindex(s, width[, i[, j[, ambiwidth[, default]]]])`
  - Same parameter changes as `utf8.width()`

Documentation:
- Rewrite all API docs in Lua official manual style
- Add comprehensive examples for all functions
- Add migration guide in Breaking Changes section
- Unify parameter naming: `s` (string), `i`/`j` (byte positions),
  `n` (character index)
- Fix grammar and formatting issues throughout README

Tests:
- Add comprehensive test coverage for `utf8.widthlimit()`
  - Basic truncation (positive/negative limits)
  - Fullwidth characters, mixed width strings
  - Substring ranges, ambiguous-width characters
  - Edge cases (empty strings, zero limit, out of bounds)
- Update existing tests for new API signatures

Migration Guide:
- `ambi_is_double = true` → `ambiwidth = 2`
- `ambi_is_double = false/nil` → `ambiwidth = 1` or omit
- Most users unaffected (only passing string parameter)

Version: 0.2.0

85 of 87 new or added lines in 1 file covered. (97.7%)

5 existing lines in 1 file now uncovered.

1118 of 1129 relevant lines covered (99.03%)

671848.07 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
2
99.03
0.0% lutf8lib.c

Uncovered Existing Lines

Lines Coverage ∆ File
5
99.03
0.0% lutf8lib.c
Jobs
ID Job ID Ran Files Coverage
1 run-5.2 - 19302506971.1 12 Nov 2025 03:23PM UTC 1
99.02
GitHub Action Run
2 run-5.4 - 19302506971.2 12 Nov 2025 03:23PM UTC 1
99.02
GitHub Action Run
3 run-luajit-openresty - 19302506971.3 12 Nov 2025 03:23PM UTC 1
99.02
GitHub Action Run
4 run-5.3 - 19302506971.4 12 Nov 2025 03:23PM UTC 1
99.02
GitHub Action Run
5 run-5.1 - 19302506971.5 12 Nov 2025 03:23PM UTC 1
99.02
GitHub Action Run
Source Files on build 19302506971
  • Tree
  • List 1
  • Changed 1
  • Source Changed 0
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 004edf4e on github
  • Prev Build on master (#19302386633)
  • Next Build on master (#19305846848)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc