Skip to content

Commit

Permalink
add a unit test for propery name
Browse files Browse the repository at this point in the history
  • Loading branch information
Hongbo Zhang committed Jun 21, 2016
1 parent 0459c2b commit e953aa9
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 5 deletions.
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.cmj : mt.cmi
gpr_459.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.cmo : mt.cmi
gpr_459.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
19 changes: 19 additions & 0 deletions jscomp/test/gpr_459.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
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 hh = uu##_'x_

let () = eq __LOC__ hh 3

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
promise
43 changes: 43 additions & 0 deletions lib/js/test/gpr_459.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
// 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 hh = uu["'x"];

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

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

exports.suites = suites;
exports.test_id = test_id;
exports.eq = eq;
exports.uu = uu;
exports.hh = hh;
/* uu Not a pure module */

0 comments on commit e953aa9

Please sign in to comment.