Skip to content

Commit effb980

Browse files
committed
add test case for non-reduandant warning
1 parent 4a6ea27 commit effb980

File tree

14 files changed

+138
-32
lines changed

14 files changed

+138
-32
lines changed

jscomp/bin/bsb.ml

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9754,8 +9754,6 @@ type cxt = {
97549754
cut_generators : bool
97559755
}
97569756

9757-
val find_first_lib_dir
9758-
: file_group list -> string
97599757

97609758
(** entry is to the
97619759
[sources] in the schema
@@ -9811,8 +9809,6 @@ type build_generator =
98119809
output : string list;
98129810
command : string}
98139811

9814-
let is_input (xs : build_generator list) (x : string) =
9815-
List.exists (fun ({input} : build_generator) -> List.exists (fun y -> y = x ) input ) xs
98169812

98179813
let is_input_or_output(xs : build_generator list) (x : string) =
98189814
List.exists
@@ -9846,17 +9842,6 @@ type t =
98469842
globbed_dirs : string list ;
98479843
}
98489844

9849-
exception No_lib_dir_found
9850-
9851-
let rec find_first_lib_dir
9852-
(file_groups : file_group list ) =
9853-
match file_groups with
9854-
| [] -> raise No_lib_dir_found
9855-
| {dir ; dir_index } :: rest ->
9856-
if Bsb_dir_index.is_lib_dir dir_index then dir
9857-
else find_first_lib_dir rest
9858-
9859-
98609845
let (//) = Ext_filename.combine
98619846

98629847
let (|?) m (key, cb) =

jscomp/bsb/bsb_parse_sources.ml

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@ type build_generator =
3737
output : string list;
3838
command : string}
3939

40-
let is_input (xs : build_generator list) (x : string) =
41-
List.exists (fun ({input} : build_generator) -> List.exists (fun y -> y = x ) input ) xs
4240

4341
let is_input_or_output(xs : build_generator list) (x : string) =
4442
List.exists
@@ -72,17 +70,6 @@ type t =
7270
globbed_dirs : string list ;
7371
}
7472

75-
exception No_lib_dir_found
76-
77-
let rec find_first_lib_dir
78-
(file_groups : file_group list ) =
79-
match file_groups with
80-
| [] -> raise No_lib_dir_found
81-
| {dir ; dir_index } :: rest ->
82-
if Bsb_dir_index.is_lib_dir dir_index then dir
83-
else find_first_lib_dir rest
84-
85-
8673
let (//) = Ext_filename.combine
8774

8875
let (|?) m (key, cb) =

jscomp/bsb/bsb_parse_sources.mli

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,6 @@ type cxt = {
6767
cut_generators : bool
6868
}
6969

70-
val find_first_lib_dir
71-
: file_group list -> string
7270

7371
(** entry is to the
7472
[sources] in the schema
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
*.exe
2+
*.obj
3+
*.out
4+
*.compile
5+
*.native
6+
*.byte
7+
*.cmo
8+
*.annot
9+
*.cmi
10+
*.cmx
11+
*.cmt
12+
*.cmti
13+
*.cma
14+
*.a
15+
*.cmxa
16+
*.obj
17+
*~
18+
*.annot
19+
*.cmj
20+
*.bak
21+
lib/bs
22+
*.mlast
23+
*.mliast
24+
.vscode
25+
.merlin
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
2+
3+
# Build
4+
```
5+
npm run build
6+
```
7+
8+
# Watch
9+
10+
```
11+
npm run watch
12+
```
13+
14+
15+
# Editor
16+
If you use `vscode`, Press `Windows + Shift + B` it will build automatically
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"name": "generator",
3+
"version": "0.1.0",
4+
"sources": [
5+
{
6+
"dir": "src",
7+
"generators": [
8+
{
9+
"name": "cpp",
10+
"edge": [
11+
"test.ml", ":", "test.cpp.ml"
12+
]
13+
}
14+
]
15+
}
16+
17+
],
18+
"generators": [
19+
{
20+
"name" : "cpp",
21+
"command": "sed 's/OCAML/3/' $in > $out"
22+
}
23+
],
24+
"bs-dependencies" : [
25+
// add your bs-dependencies here
26+
]
27+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
2+
3+
var child_process = require('child_process')
4+
var assert = require('assert')
5+
var output = child_process.spawnSync(`bsb -clean-world && bsb -make-world`,
6+
{
7+
cwd: __dirname,
8+
encoding: 'utf8',
9+
stdio : ['pipe','pipe','pipe'],
10+
shell : true
11+
}
12+
)
13+
// console.log(output)
14+
// var matches = output.match(/IGNORED/g)
15+
// console.log(matches)
16+
17+
assert.equal((output.stderr.match(/IGNORED/g)).length, 1)
18+
assert.equal(output.stderr.indexOf('a-b.ml') > 0, true)
19+
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"name": "generator",
3+
"version": "0.1.0",
4+
"scripts": {
5+
"clean": "bsb -clean-world",
6+
"build": "bsb -make-world",
7+
"watch": "bsb -make-world -w"
8+
},
9+
"keywords": [
10+
"BuckleScript"
11+
],
12+
"license": "MIT",
13+
"devDependencies": {
14+
"bs-platform": "1.8.3"
15+
}
16+
}

jscomp/build_tests/generator/src/a-b.ml

Whitespace-only changes.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
2+
3+
let () = Js.log "Hello, BuckleScript"

0 commit comments

Comments
 (0)