Skip to content

Commit

Permalink
Bugfix: more than 1 "and {time}" didn't work
Browse files Browse the repository at this point in the history
  • Loading branch information
mattiasnordqvist committed Apr 1, 2016
1 parent dd053f0 commit 73bacc3
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion GoldenFox.ANTLR/GoldenFoxLanguage.g4
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ between: 'between' time 'and' time;
from: 'from' datetime;
until: 'until' datetime;
time: (INT':'INT(':'INT)?);
times: time ('and' time)?;
times: time ('and' times)?;
weekday: ('monday' | 'tuesday' | 'wednesday' | 'thursday' | 'friday' | 'saturday' | 'sunday');
numberedDay: INT('st'|'nd'|'rd'|'th');
datetime: (date)(time)?;
Expand Down
1 change: 0 additions & 1 deletion GoldenFox/Internal/Operators/First.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;

namespace GoldenFox.Internal.Operators
{
Expand Down
4 changes: 2 additions & 2 deletions GoldenFox/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
[assembly: AssemblyCopyright("Copyright © Mattias Nordqvist")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: AssemblyVersion("2.2.0")]
[assembly: AssemblyFileVersion("2.2.0")]
[assembly: AssemblyVersion("2.2.1")]
[assembly: AssemblyFileVersion("2.2.1")]
[assembly: AssemblyProduct("Golden Fox")]
[assembly: AssemblyCompany("Mattias Nordqvist")]

Expand Down
10 changes: 10 additions & 0 deletions Tests/Full/ScheduleTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,16 @@ namespace Tests.Full
[TestFixture]
public class ScheduleTests
{
[Test]
public void TestFromSomeLiveCode()
{
"every day @ 06:00 and 12:00 and 18:00".From("2016-04-01 05:49").Gives("2016-04-01 06:00");
"every day @ 06:00 and 12:00 and 18:00".From("2016-04-01 11:49").Gives("2016-04-01 12:00");
"every day @ 06:00 and 12:00 and 18:00".From("2016-04-01 15:49").Gives("2016-04-01 18:00");
"every day @ 06:00 and 12:00 and 18:00".From("2016-04-01 18:49").Gives("2016-04-02 06:00");

}

[Test]
public void EveryHour()
{
Expand Down

0 comments on commit 73bacc3

Please sign in to comment.