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 docstring tests #7219

Merged
merged 1 commit into from
Jan 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
9 changes: 5 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,15 @@

# 12.0.0-alpha.7 (Unreleased)

#### :nail_care: Polish

- Add all standard CSS properties to `JsxDOMStyle`. https://github.com/rescript-lang/rescript/pull/7205

#### :house: Internal

- AST cleanup: use inline record for Pexp_fun. https://github.com/rescript-lang/rescript/pull/7213
- Add support for "dot completion everywhere" (Ported from https://github.com/rescript-lang/rescript-vscode/pull/1054). https://github.com/rescript-lang/rescript/pull/7226

#### :nail_care: Polish

- Add all standard CSS properties to `JsxDOMStyle`. https://github.com/rescript-lang/rescript/pull/7205
- Add assertions to stdlib docstring examples. Extract examples into Mocha tests, compile and run the tests in CI. https://github.com/rescript-lang/rescript/pull/7219

# 12.0.0-alpha.6

Expand Down
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/docstring_tests/**",
"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 assertEqual(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,
assertEqual,
}
/* 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 assertEqual(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.assertEqual = assertEqual;
/* No side effect */
Loading
Loading