Skip to content

Commit 56fd818

Browse files
committed
hack around unused package warning
1 parent 7fa84f1 commit 56fd818

27 files changed

+387
-12
lines changed

src/fs/dir_test.mbt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ async test "read_all" {
2424
"fs.mbt", "stub.c", "dir.mbt", "README.md", "utils.mbt", "dir_test.mbt", "eof_test.mbt",
2525
"README.mbt.md", "constants.mbt", "moon.pkg.json", "stat_test.mbt", "walk_test.mbt",
2626
"mkdir_test.mbt", "access_test.mbt", "create_test.mbt", "seek_wbtest.mbt", "read_all_test.mbt",
27-
"realpath_test.mbt", "pkg.generated.mbti", "text_file_test.mbt", "timestamp_test.mbt",
28-
"random_access_test.mbt",
27+
"realpath_test.mbt", "unimplemented.mbt", "pkg.generated.mbti", "text_file_test.mbt",
28+
"timestamp_test.mbt", "random_access_test.mbt",
2929
])
3030
}
3131

@@ -56,7 +56,7 @@ async test "as_dir" {
5656
"constants.mbt: Regular", "moon.pkg.json: Regular", "stat_test.mbt: Regular",
5757
"walk_test.mbt: Regular", "mkdir_test.mbt: Regular", "access_test.mbt: Regular",
5858
"create_test.mbt: Regular", "seek_wbtest.mbt: Regular", "read_all_test.mbt: Regular",
59-
"realpath_test.mbt: Regular", "pkg.generated.mbti: Regular", "text_file_test.mbt: Regular",
60-
"timestamp_test.mbt: Regular", "random_access_test.mbt: Regular",
59+
"realpath_test.mbt: Regular", "unimplemented.mbt: Regular", "pkg.generated.mbti: Regular",
60+
"text_file_test.mbt: Regular", "timestamp_test.mbt: Regular", "random_access_test.mbt: Regular",
6161
])
6262
}

src/fs/eof_test.mbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ async test "read EOF" {
2929
@fs.remove(path)
3030
assert_eq(n, 4)
3131
inspect(
32-
@bytes_util.ascii_to_string(buf.unsafe_reinterpret_as_bytes()[0:n]),
32+
@encoding/utf8.decode(buf.unsafe_reinterpret_as_bytes()[0:n]),
3333
content="abcd",
3434
)
3535
}

src/fs/moon.pkg.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@
77
"moonbitlang/async",
88
"moonbitlang/async/semaphore"
99
],
10-
"test-import": [
11-
"moonbitlang/async/internal/bytes_util"
12-
],
1310
"targets": {
1411
"access_test.mbt": [ "native" ],
1512
"constants.mbt": [ "native" ],

src/fs/unimplemented.mbt

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// Copyright 2025 International Digital Economy Academy
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
///|
16+
/// This package currently does not support JavaScript backend
17+
#cfg(target="js")
18+
pub let unimplemented : Unit = {
19+
ignore(@io.pipe)
20+
ignore(@async.sleep)
21+
ignore(@event_loop.sleep)
22+
ignore(@semaphore.Semaphore::acquire)
23+
ignore(@os_error.unimplemented)
24+
ignore(@fd_util.unimplemented)
25+
}

src/http/unimplemented.mbt

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// Copyright 2025 International Digital Economy Academy
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
///|
16+
/// This package currently does not support JavaScript backend
17+
#cfg(target="js")
18+
pub let unimplemented : Unit = {
19+
ignore(@io.pipe)
20+
ignore(@socket.unimplemented)
21+
ignore(@tls.unimplemented)
22+
}

src/http/unimplemented_test.mbt

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// Copyright 2025 International Digital Economy Academy
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
///|
16+
#cfg(target="js")
17+
let _ignore_unused_import : Unit = ignore(@async.sleep)

src/http/unimplemented_wbtest.mbt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// Copyright 2025 International Digital Economy Academy
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
///|
16+
#cfg(target="js")
17+
let _ignore_unused_import : Unit = {
18+
ignore(@async.sleep)
19+
ignore(@fs.unimplemented)
20+
ignore(@bytes_util.ascii_to_string)
21+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// Copyright 2025 International Digital Economy Academy
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
///|
16+
/// This package currently does not support JavaScript backend
17+
#cfg(target="js")
18+
pub let unimplemented : Unit = ()

src/internal/event_loop/event_loop.js.mbt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,14 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15+
///|
16+
let _ignore_unused_import : Unit = {
17+
ignore(@c_buffer.unimplemented)
18+
ignore(@fd_util.unimplemented)
19+
ignore(@os_error.unimplemented)
20+
ignore(@time.ms_since_epoch)
21+
}
22+
1523
///|
1624
#external
1725
priv type Timer

src/internal/event_loop/moon.pkg.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@
2323
"poll.mbt": [ "native" ],
2424
"thread_pool.mbt": [ "native" ],
2525
"timer.mbt": [ "native" ],
26-
"event_loop.js.mbt": [ "js" ],
27-
"worker_wbtest.mbt": [ "native" ]
26+
"event_loop.js.mbt": [ "js" ]
2827
},
2928
"native-stub": [ "poll.c", "thread_pool.c", "misc_stub.c" ]
3029
}

0 commit comments

Comments
 (0)