Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add docstrings compiler tests #7184

Draft
wants to merge 28 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"tests/tests/**",
"tests/tools_tests/**",
"tests/analysis_tests/**",
"tests/docstrings_examples/**",
"analysis/examples/**",
"analysis/reanalyze/examples/**",
"lib/**",
Expand Down
17 changes: 17 additions & 0 deletions lib/es6/Pervasives.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@


import * as $$Error from "./Error.js";
import * as Primitive_object from "./Primitive_object.js";
import * as Primitive_exceptions from "./Primitive_exceptions.js";

function failwith(s) {
Expand Down Expand Up @@ -116,6 +117,21 @@ function $at(l1, l2) {
}
}

function assert_eq(a, b) {
if (!Primitive_object.notequal(a, b)) {
return;
}
throw {
RE_EXN_ID: "Assert_failure",
_1: [
"Pervasives.res",
596,
4
],
Error: new Error()
};
}

let max_int = 2147483647;

let infinity = Infinity;
Expand Down Expand Up @@ -151,5 +167,6 @@ export {
int_of_string_opt,
$at,
panic,
assert_eq,
}
/* No side effect */
17 changes: 17 additions & 0 deletions lib/js/Pervasives.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use strict';

let $$Error = require("./Error.js");
let Primitive_object = require("./Primitive_object.js");
let Primitive_exceptions = require("./Primitive_exceptions.js");

function failwith(s) {
Expand Down Expand Up @@ -116,6 +117,21 @@ function $at(l1, l2) {
}
}

function assert_eq(a, b) {
if (!Primitive_object.notequal(a, b)) {
return;
}
throw {
RE_EXN_ID: "Assert_failure",
_1: [
"Pervasives.res",
596,
4
],
Error: new Error()
};
}

let max_int = 2147483647;

let infinity = Infinity;
Expand Down Expand Up @@ -150,4 +166,5 @@ exports.bool_of_string_opt = bool_of_string_opt;
exports.int_of_string_opt = int_of_string_opt;
exports.$at = $at;
exports.panic = panic;
exports.assert_eq = assert_eq;
/* No side effect */
Loading
Loading