Skip to content

Commit af11e23

Browse files
committed
Generation of all demo programs + modif specs
2 parents b9c9b91 + 6e75462 commit af11e23

File tree

276 files changed

+3931
-3434
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

276 files changed

+3931
-3434
lines changed

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ if(NOT FYPP)
4949
endif()
5050

5151
add_subdirectory(src)
52+
add_subdirectory(test)
5253

5354
install(EXPORT ${PROJECT_NAME}-targets
5455
NAMESPACE ${PROJECT_NAME}::

doc/specs/stdlib_array.md

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,7 @@ Returns an array of default integer size, with a maximum length of `size(array)`
4646
#### Examples
4747

4848
```fortran
49-
program demo_trueloc
50-
use stdlib_array, only : trueloc
51-
implicit none
52-
real, allocatable :: array(:)
53-
allocate(array(500))
54-
call random_number(array)
55-
array(trueloc(array > 0.5)) = 0.0
56-
end program demo_trueloc
49+
{!test/examples/array/demo_trueloc.f90!}
5750
```
5851

5952

@@ -90,12 +83,5 @@ Returns an array of default integer size, with a maximum length of `size(array)`
9083
#### Examples
9184

9285
```fortran
93-
program demo_falseloc
94-
use stdlib_array, only : falseloc
95-
implicit none
96-
real, allocatable :: array(:)
97-
allocate(array(-200:200))
98-
call random_number(array)
99-
array(falseloc(array < 0.5), lbound(array)) = 0.0
100-
end program demo_falseloc
86+
{!test/examples/array/demo_falseloc.f90!}
10187
```

doc/specs/stdlib_ascii.md

Lines changed: 5 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,7 @@ The result is an intrinsic character type of the same length as `string`.
5151
#### Example
5252

5353
```fortran
54-
program demo_to_lower
55-
use stdlib_ascii, only : to_lower
56-
implicit none
57-
print'(a)', to_lower("HELLo!") ! returns "hello!"
58-
end program demo_to_lower
54+
{!test/examples/ascii/demo_to_lower.f90!}
5955
```
6056

6157
### `to_upper`
@@ -87,11 +83,7 @@ The result is an intrinsic character type of the same length as `string`.
8783
#### Example
8884

8985
```fortran
90-
program demo_to_upper
91-
use stdlib_ascii, only : to_upper
92-
implicit none
93-
print'(a)', to_upper("hello!") ! returns "HELLO!"
94-
end program demo_to_upper
86+
{!test/examples/ascii/demo_to_upper.f90!}
9587
```
9688

9789
### `to_title`
@@ -128,13 +120,7 @@ The result is an intrinsic character type of the same length as `string`.
128120
#### Example
129121

130122
```fortran
131-
program demo_to_title
132-
use stdlib_ascii, only : to_title
133-
implicit none
134-
print*, to_title("hello there!") ! returns "Hello There!"
135-
print*, to_title("'enquoted'") ! returns "'Enquoted'"
136-
print*, to_title("1st") ! returns "1st"
137-
end program demo_to_title
123+
{!test/examples/ascii/demo_to_title.f90!}
138124
```
139125

140126
### `to_sentence`
@@ -169,13 +155,7 @@ The result is an intrinsic character type of the same length as `string`.
169155
#### Example
170156

171157
```fortran
172-
program demo_to_sentence
173-
use stdlib_ascii, only : to_sentence
174-
implicit none
175-
print*, to_sentence("hello!") ! returns "Hello!"
176-
print*, to_sentence("'enquoted'") ! returns "'Enquoted'"
177-
print*, to_sentence("1st") ! returns "1st"
178-
end program demo_to_sentence
158+
{!test/examples/ascii/demo_to_sentence.f90!}
179159
```
180160

181161
### `reverse`
@@ -207,9 +187,5 @@ The result is an intrinsic character type of the same length as `string`.
207187
#### Example
208188

209189
```fortran
210-
program demo_reverse
211-
use stdlib_ascii, only : reverse
212-
implicit none
213-
print'(a)', reverse("Hello, World!") ! returns "!dlroW ,olleH"
214-
end program demo_reverse
190+
{!test/examples/ascii/demo_reverse.f90!}
215191
```

0 commit comments

Comments
 (0)