-
Notifications
You must be signed in to change notification settings - Fork 471
Remove ocaml_compat stuff from tests #7871
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,6 @@ | |
|
||
import * as Mocha from "mocha"; | ||
import * as Test_utils from "./test_utils.mjs"; | ||
import * as Primitive_array from "@rescript/runtime/lib/es6/Primitive_array.js"; | ||
|
||
let v = [ | ||
1, | ||
|
@@ -22,7 +21,7 @@ function f(v) { | |
} | ||
|
||
function fff(x) { | ||
return true; | ||
return x.length >= 0; | ||
} | ||
|
||
function fff2(x) { | ||
|
@@ -34,11 +33,15 @@ function fff2(x) { | |
} | ||
|
||
function fff3(x) { | ||
return 1; | ||
if (x.length >= 0) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here |
||
return 1; | ||
} else { | ||
return 2; | ||
} | ||
} | ||
|
||
function fff4(x) { | ||
if (x.length !== 0) { | ||
if (x.length > 0) { | ||
return 1; | ||
} else { | ||
return 2; | ||
|
@@ -53,7 +56,7 @@ Mocha.describe("Array_subtle_test", () => { | |
3, | ||
3 | ||
]; | ||
Test_utils.eq("File \"array_subtle_test.res\", line 40, characters 7-14", 4, v.length); | ||
Test_utils.eq("File \"array_subtle_test.res\", line 38, characters 7-14", 4, v.length); | ||
}); | ||
Mocha.test("array_push_test", () => { | ||
let v = [ | ||
|
@@ -62,9 +65,9 @@ Mocha.describe("Array_subtle_test", () => { | |
3, | ||
3 | ||
]; | ||
Test_utils.eq("File \"array_subtle_test.res\", line 45, characters 7-14", 5, v.push(3)); | ||
Test_utils.eq("File \"array_subtle_test.res\", line 46, characters 7-14", 5, v.length); | ||
Test_utils.eq("File \"array_subtle_test.res\", line 47, characters 7-14", 5, v.length); | ||
Test_utils.eq("File \"array_subtle_test.res\", line 43, characters 7-14", 5, v.push(3)); | ||
Test_utils.eq("File \"array_subtle_test.res\", line 44, characters 7-14", 5, v.length); | ||
Test_utils.eq("File \"array_subtle_test.res\", line 45, characters 7-14", 5, v.length); | ||
}); | ||
Mocha.test("array_mutation_test", () => { | ||
let v = [ | ||
|
@@ -73,9 +76,9 @@ Mocha.describe("Array_subtle_test", () => { | |
3, | ||
3 | ||
]; | ||
Test_utils.eq("File \"array_subtle_test.res\", line 52, characters 7-14", 3, Primitive_array.get(v, 2)); | ||
Primitive_array.set(v, 2, 4); | ||
Test_utils.eq("File \"array_subtle_test.res\", line 54, characters 7-14", 4, Primitive_array.get(v, 2)); | ||
Test_utils.eq("File \"array_subtle_test.res\", line 50, characters 7-14", 3, v[2]); | ||
v[2] = 4; | ||
Test_utils.eq("File \"array_subtle_test.res\", line 52, characters 7-14", 4, v[2]); | ||
}); | ||
Mocha.test("array_pop_test", () => { | ||
let v = [ | ||
|
@@ -87,19 +90,16 @@ Mocha.describe("Array_subtle_test", () => { | |
while (v.length > 0) { | ||
v.pop(); | ||
}; | ||
Test_utils.eq("File \"array_subtle_test.res\", line 62, characters 7-14", 0, v.length); | ||
Test_utils.eq("File \"array_subtle_test.res\", line 60, characters 7-14", 0, v.length); | ||
}); | ||
Mocha.test("array_function_tests", () => { | ||
Test_utils.eq("File \"array_subtle_test.res\", line 66, characters 7-14", 1, fff3([])); | ||
Test_utils.eq("File \"array_subtle_test.res\", line 67, characters 7-14", 2, fff4([])); | ||
Test_utils.eq("File \"array_subtle_test.res\", line 68, characters 7-14", 1, fff4([1])); | ||
Test_utils.eq("File \"array_subtle_test.res\", line 64, characters 7-14", 1, fff3([])); | ||
Test_utils.eq("File \"array_subtle_test.res\", line 65, characters 7-14", 2, fff4([])); | ||
Test_utils.eq("File \"array_subtle_test.res\", line 66, characters 7-14", 1, fff4([1])); | ||
}); | ||
}); | ||
|
||
let $$Array; | ||
|
||
export { | ||
$$Array, | ||
v, | ||
f, | ||
fff, | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change is interesting. Will make a separate PR regarding that.