Skip to content

Windows: absolute glob expansion fails in ls() and CliArguments #2

@tsavo-at-pieces

Description

@tsavo-at-pieces

Problem

Absolute glob expansion fails on Windows in two places:

  • test/ls_test.dart: ls() an absolute glob expands to absolute paths
  • test/cli_arguments_test.dart: globbing with glob: true an absolute glob expands to absolute paths

In CI, expected expanded files are not returned; the pattern is treated as a literal *.txt path.

Reproduction

Suspected root cause

Glob patterns are being constructed/handled with Windows path separators (\\) instead of POSIX-style separators (/) expected by the glob package parser.

Expected behavior

When glob: true, absolute patterns on Windows should expand to matching absolute file paths, same as Linux/macOS semantics.

Proposed approach

  1. Normalize glob pattern input to POSIX-style separators before constructing Glob(...).
  2. Ensure ls() and CliArguments follow the same normalization strategy.
  3. Add explicit Windows tests for:
    • absolute glob expansion
    • Windows-style backslash input normalization

Acceptance criteria

  • Both failing absolute-glob tests pass on windows-x64 and windows-arm64
  • Existing Linux/macOS glob tests remain green
  • No regressions in non-glob argument parsing

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions