Skip to content

add a unit test for propery name #460

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 2 commits into from
Jun 21, 2016
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
8 changes: 4 additions & 4 deletions jscomp/test/.depend
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,8 @@ gpr_405_test.cmj : ../stdlib/hashtbl.cmi gpr_405_test.cmi
gpr_405_test.cmx : ../stdlib/hashtbl.cmx gpr_405_test.cmi
gpr_441.cmj :
gpr_441.cmx :
gpr_459_test.cmj : mt.cmi
gpr_459_test.cmx : mt.cmx
guide_for_ext.cmj :
guide_for_ext.cmx :
hamming_test.cmj : ../stdlib/printf.cmi mt.cmi ../stdlib/lazy.cmi \
Expand Down Expand Up @@ -384,8 +386,6 @@ printf_sim.cmj : ../stdlib/printf.cmi
printf_sim.cmx : ../stdlib/printf.cmx
printf_test.cmj : ../stdlib/printf.cmi mt.cmi ../stdlib/format.cmi
printf_test.cmx : ../stdlib/printf.cmx mt.cmx ../stdlib/format.cmx
promise.cmj : ../runtime/js.cmj
promise.cmx : ../runtime/js.cmx
qcc.cmj : ../stdlib/sys.cmi ../stdlib/string.cmi ../stdlib/printf.cmi \
../stdlib/list.cmi ../stdlib/char.cmi ../stdlib/bytes.cmi \
../stdlib/array.cmi
Expand Down Expand Up @@ -892,6 +892,8 @@ gpr_405_test.cmo : ../stdlib/hashtbl.cmi gpr_405_test.cmi
gpr_405_test.cmj : ../stdlib/hashtbl.cmj gpr_405_test.cmi
gpr_441.cmo :
gpr_441.cmj :
gpr_459_test.cmo : mt.cmi
gpr_459_test.cmj : mt.cmj
guide_for_ext.cmo :
guide_for_ext.cmj :
hamming_test.cmo : ../stdlib/printf.cmi mt.cmi ../stdlib/lazy.cmi \
Expand Down Expand Up @@ -1052,8 +1054,6 @@ printf_sim.cmo : ../stdlib/printf.cmi
printf_sim.cmj : ../stdlib/printf.cmj
printf_test.cmo : ../stdlib/printf.cmi mt.cmi ../stdlib/format.cmi
printf_test.cmj : ../stdlib/printf.cmj mt.cmj ../stdlib/format.cmj
promise.cmo : ../runtime/js.cmo
promise.cmj : ../runtime/js.cmj
qcc.cmo : ../stdlib/sys.cmi ../stdlib/string.cmi ../stdlib/printf.cmi \
../stdlib/list.cmi ../stdlib/char.cmi ../stdlib/bytes.cmi \
../stdlib/array.cmi
Expand Down
30 changes: 30 additions & 0 deletions jscomp/test/gpr_459_test.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
[@@@bs.config{non_export=true}]

let suites : Mt.pair_suites ref = ref []
let test_id = ref 0
let eq loc x y =
incr test_id ;
suites :=
(loc ^" id " ^ (string_of_int !test_id), (fun _ -> Mt.Eq(x,y))) :: !suites



let uu = {
_'x_ = 3;

} [@bs.obj]

let uu2 = {
then_ = 1;
catch = 2;
_'x_ = 3
} [@bs.obj]

let hh = uu##_'x_

let () = eq __LOC__ hh 3

let () =
eq __LOC__ (1,2,3) (uu2##then_, uu2##catch, uu2##_'x_)

let () = Mt.from_pair_suites __FILE__ !suites
2 changes: 1 addition & 1 deletion jscomp/test/test.mllib
Original file line number Diff line number Diff line change
Expand Up @@ -332,5 +332,5 @@ noassert
test_unsafe_cmp

gpr_441

gpr_459_test
promise
54 changes: 54 additions & 0 deletions lib/js/test/gpr_459_test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
// GENERATED CODE BY BUCKLESCRIPT VERSION 0.5.5 , PLEASE EDIT WITH CARE
'use strict';

var Mt = require("./mt");
var Block = require("../block");

var suites = [/* [] */0];

var test_id = [0];

function eq(loc, x, y) {
test_id[0] = test_id[0] + 1 | 0;
suites[0] = /* :: */[
/* tuple */[
loc + (" id " + test_id[0]),
function () {
return /* Eq */Block.__(0, [
x,
y
]);
}
],
suites[0]
];
return /* () */0;
}

var uu = {
"'x": 3
};

var uu2 = {
then: 1,
catch: 2,
"'x": 3
};

var hh = uu["'x"];

eq('File "gpr_459_test.ml", line 25, characters 12-19', hh, 3);

eq('File "gpr_459_test.ml", line 28, characters 5-12', /* tuple */[
1,
2,
3
], /* tuple */[
uu2.then,
uu2.catch,
uu2["'x"]
]);

Mt.from_pair_suites("gpr_459_test.ml", suites[0]);

/* uu Not a pure module */