Skip to content

tests: cover leading empty fields in base_str_split #503

Description

@codeforester

Goal

Add focused regression coverage for a leading empty field produced by base_str_split.

Background

The existing BATS tests cover empty fields between repeated separators and after a trailing separator, but do not cover a value that starts with the separator. The helper currently preserves this field; documenting and testing that boundary makes the behavior clear to new users.

Scope

Add one BATS case in lib/bash/str/tests/lib_str.bats and a concise behavior note in lib/bash/str/README.md. Do not change production behavior or public signatures.

Acceptance Criteria

  • Splitting ,alpha,beta on , produces three elements: empty string, alpha, and beta.
  • The string-library README states that leading empty fields are preserved.
  • The focused string-library BATS file and full repository validation pass.

Validation

Run bats lib/bash/str/tests/lib_str.bats and ./tests/validate.sh.

Non-Goals

No API or implementation change.

Project Fields

  • Status: Ready
  • Priority: P3
  • Area: CI
  • Initiative: Adoption Polish
  • Size: S
  • Milestone: v2.2.0
  • Target date: unset.

Agent Assignment

Unassigned and open to first-time contributors.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ciContinuous integration, tests, automation, or release workflowsgood first issueGood for newcomers

    Type

    No type

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions