Skip to content

Commit

Permalink
chore: self mutation (e2e-1of2.diff)
Browse files Browse the repository at this point in the history
Signed-off-by: monada-bot[bot] <[email protected]>
  • Loading branch information
monadabot committed Apr 10, 2024
1 parent a6135c0 commit 93cfc0c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@

## stdout.log
```log
pass ─ regex.test.wsim » root/env0/test:regex
pass ─ regex.test.wsim » root/env1/test:regex.match()
pass ─ regex.test.wsim » root/env0/test:regex
Tests 2 passed (2)
Tests 1 passed (1)
Snapshots 1 skipped
Test Files 1 passed (1)
Duration <DURATION>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@
```cjs
"use strict";
const $helpers = require("@winglang/sdk/lib/helpers");
module.exports = function({ $api_url, $std_Regex, $token_len, $url_regex }) {
module.exports = function({ $_urlRegex_test_api_url__, $api_url, $expect_Util, $tokenLength }) {
class $Closure1 {
constructor({ }) {
const $obj = (...args) => this.handle(...args);
Object.setPrototypeOf($obj, this);
return $obj;
}
async handle() {
$helpers.assert((await $std_Regex.match($url_regex, $api_url)), "regex.match(url_regex, api.url)");
$helpers.assert($api_url.startsWith("http"), "api.url.startsWith(\"http\")");
$helpers.assert($helpers.neq($api_url.length, $token_len), "api.url.length != token_len");
(await $expect_Util.equal($_urlRegex_test_api_url__, false));
(await $expect_Util.equal($api_url.startsWith("http"), true));
(await $expect_Util.notEqual($api_url.length, $tokenLength));
}
}
return $Closure1;
Expand Down Expand Up @@ -137,6 +137,7 @@ const $wing_is_test = process.env.WING_IS_TEST === "true";
const std = $stdlib.std;
const $helpers = $stdlib.helpers;
const cloud = $stdlib.cloud;
const expect = $stdlib.expect;
class $Root extends $stdlib.std.Resource {
constructor($scope, $id) {
super($scope, $id);
Expand All @@ -149,10 +150,10 @@ class $Root extends $stdlib.std.Resource {
static _toInflightType() {
return `
require("${$helpers.normalPath(__dirname)}/inflight.$Closure1-1.cjs")({
$_urlRegex_test_api_url__: ${$stdlib.core.liftObject((urlRegex.test(api.url)))},
$api_url: ${$stdlib.core.liftObject(api.url)},
$std_Regex: ${$stdlib.core.liftObject($stdlib.core.toLiftableModuleType(std.Regex, "@winglang/sdk/std", "Regex"))},
$token_len: ${$stdlib.core.liftObject(token_len)},
$url_regex: ${$stdlib.core.liftObject(url_regex)},
$expect_Util: ${$stdlib.core.liftObject($stdlib.core.toLiftableModuleType(expect.Util, "@winglang/sdk/expect", "Util"))},
$tokenLength: ${$stdlib.core.liftObject(tokenLength)},
})
`;
}
Expand All @@ -170,22 +171,22 @@ class $Root extends $stdlib.std.Resource {
get _liftMap() {
return ({
"handle": [
[(urlRegex.test(api.url)), []],
[api.url, [].concat(["startsWith"], ["length"])],
[token_len, []],
[url_regex, []],
[tokenLength, []],
],
"$inflight_init": [
[(urlRegex.test(api.url)), []],
[api.url, []],
[token_len, []],
[url_regex, []],
[tokenLength, []],
],
});
}
}
const api = this.node.root.new("@winglang/sdk.cloud.Api", cloud.Api, this, "Api");
const url_regex = "https?:\\/\\/(www\\.)?[-a-zA-Z0-9@:%._\\+~#=]{1,256\}\\.[a-zA-Z0-9()]{1,6\}\\b([-a-zA-Z0-9()@:%_\\+.~#?&//=]*)";
$helpers.assert((!(std.Regex.match(url_regex, api.url))), "!regex.match(url_regex, api.url)");
const token_len = api.url.length;
const urlRegex = (std.Regex.compile("https?:\\/\\/(www\\.)?[-a-zA-Z0-9@:%._\\+~#=]{1,256\}\\.[a-zA-Z0-9()]{1,6\}\\b([-a-zA-Z0-9()@:%_\\+.~#?&//=]*)"));
(expect.Util.equal((urlRegex.test(api.url)), false));
const tokenLength = api.url.length;
this.node.root.new("@winglang/sdk.std.Test", std.Test, this, "test:phase independent method on string evaluated inflight", new $Closure1(this, "$Closure1"));
}
}
Expand Down

0 comments on commit 93cfc0c

Please sign in to comment.