Skip to content
This repository has been archived by the owner on Feb 7, 2019. It is now read-only.

adds missing clock properties #51

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

anuragpeshne
Copy link
Collaborator

have a look at the test regex. Would it better to get current time values and then compare?

@@ -0,0 +1,8 @@
import { LibraryTypeInstance, LibraryMethodInstance, LibraryPropertyInstance, LibraryEventInstance } from "../libraries";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we adding this file?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It slipped through my notice. I'll amend my commit.

@@ -11,7 +11,149 @@ x = Clock.Time`);
engine.execute(ExecutionMode.RunToEnd);

const value = engine.memory.values["x"];
expect(value.toValueString()).toMatch(/[0-9]{2}:[0-9]{2}:[0-9]{2}/);
expect(value.toValueString()).toMatch(/[0-9]{2}:[0-9]{2}:[0-9]{2} A|PM/);
Copy link
Member

@OmarTawfik OmarTawfik Oct 27, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It appears that adding the AM/PM made the tests fail. Why did we do that?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Strange. On the contrary, tests were failing on my system without it. Maybe it depends on the locale? In that case we should manually construct the string?

Copy link
Collaborator Author

@anuragpeshne anuragpeshne Nov 5, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can easily reproduce this, just try:
LANG=en_US node -e 'console.log((new Date()).toLocaleString())'

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants