This commit is contained in:
swrup 2025-11-11 02:07:51 +01:00
parent aa2ff7b2f0
commit 2f3113f55d
11742 changed files with 1223940 additions and 0 deletions

View file

@ -0,0 +1,26 @@
Dash are allowed in project names and should be accepted:
$ dune init project dash-exe
Entering directory 'dash-exe'
Success: initialized project component named dash-exe
Leaving directory 'dash-exe'
$ cd dash-exe && dune build
$ dune init project dash-lib --kind=library
Entering directory 'dash-lib'
Success: initialized project component named dash-lib
Leaving directory 'dash-lib'
$ cd dash-lib && dune build
Invalid project names should still be rejected:
$ dune init project invalid.name
dune: NAME argument: invalid project name `invalid.name'
Project names must start with a letter and be composed only of
letters,
numbers, '-' or '_'
Usage: dune init project [OPTION] NAME [PATH]
Try 'dune init project --help' or 'dune --help' for more information.
[1]
$ dune_cmd exists invalid.name
false

View file

@ -0,0 +1,4 @@
#7108: foo-bar is a valid public name, we should accept it.
$ dune init lib foo_bar --public foo-bar
Success: initialized library component named foo_bar

View file

@ -0,0 +1,10 @@
01_module is not a valid module name, this should be detected before trying to `dune build`:
$ dune init project 01_module
Entering directory '01_module'
Error: "01_module" is an invalid module name.
Module names must be non-empty, start with a letter, and composed only of the
following characters: 'A'..'Z', 'a'..'z', '_', ''' or '0'..'9'.
Hint: M01_module would be a correct module name
Leaving directory '01_module'
[1]

View file

@ -0,0 +1,9 @@
When a public name is implicit from the name, it should still be validated as a
public name.
$ dune init lib 0 --public
Error: Public names are composed of an opam package name and optional
dot-separated string suffixes.
Package names can contain letters, numbers, '-', '_' and '+', and need to
contain at least a letter.
[1]

View file

@ -0,0 +1,4 @@
Sub-library names should be accepted:
$ dune init lib lib_s1_s2 --public lib.sub1.sub2
Success: initialized library component named lib_s1_s2