esniff/test/accessed-properties.js
raw| 1 | "use strict"; |
| 2 | |
| 3 | var readFile = require("fs").readFile |
| 4 | , ast = require("./_ast-accessed-properties") |
| 5 | , pg = __dirname + "/__playground"; |
| 6 | |
| 7 | module.exports = function (t, a, d) { |
| 8 | readFile(pg + "/accessed-properties.js", "utf-8", function (err, str) { |
| 9 | var plainR, astR; |
| 10 | if (err) { |
| 11 | d(err); |
| 12 | return; |
| 13 | } |
| 14 | plainR = t("foo")(str); |
| 15 | astR = ast(str); |
| 16 | a(plainR.length, astR.length, "Length"); |
| 17 | astR.forEach(function (val, i) { a.deep(plainR[i], val, i); }); |
| 18 | d(); |
| 19 | }); |
| 20 | }; |