Skip to content

Commit

Permalink
Switch high/low order for LIST and NEWGROUPS
Browse files Browse the repository at this point in the history
  • Loading branch information
rlidwka committed Apr 27, 2017
1 parent 895fcaf commit 689e956
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion lib/commands/list.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ module.exports = {
return session.server._getGroups(session)
.then(groups =>
[ status._215_INFO_FOLLOWS ]
.concat(groups.map(g => `${g.name} ${g.min_index} ${g.max_index} n`))
.concat(groups.map(g => `${g.name} ${g.max_index} ${g.min_index} n`))
.concat([ '.' ])
);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/commands/list_active.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ module.exports = {
return session.server._getGroups(session, 0, wildmat)
.then(groups =>
[ status._215_INFO_FOLLOWS ]
.concat(groups.map(g => `${g.name} ${g.min_index} ${g.max_index} n`))
.concat(groups.map(g => `${g.name} ${g.max_index} ${g.min_index} n`))
.concat([ '.' ])
);
},
Expand Down
2 changes: 1 addition & 1 deletion lib/commands/newgroups.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ module.exports = {
return session.server._getGroups(session, ts)
.then(groups =>
[ status._215_INFO_FOLLOWS ]
.concat(groups.map(g => `${g.name} ${g.min_index} ${g.max_index} n`))
.concat(groups.map(g => `${g.name} ${g.max_index} ${g.min_index} n`))
.concat([ '.' ])
);
}
Expand Down
20 changes: 10 additions & 10 deletions test/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -360,8 +360,8 @@ describe('commands', function () {
return client
.send('LIST')
.expect(/^215 /)
.expect('test.groups.foo 1 2 n')
.expect('test.groups.bar 1 3 n')
.expect('test.groups.foo 2 1 n')
.expect('test.groups.bar 3 1 n')
.expect('test.groups.empty 0 0 n')
.expect('.');
});
Expand All @@ -376,8 +376,8 @@ describe('commands', function () {
return client
.send('LIST ACTIVE')
.expect(/^215 /)
.expect('test.groups.foo 1 2 n')
.expect('test.groups.bar 1 3 n')
.expect('test.groups.foo 2 1 n')
.expect('test.groups.bar 3 1 n')
.expect('test.groups.empty 0 0 n')
.expect('.');
});
Expand All @@ -386,7 +386,7 @@ describe('commands', function () {
return client
.send('LIST ACTIVE *.foo,*.empty')
.expect(/^215 /)
.expect('test.groups.foo 1 2 n')
.expect('test.groups.foo 2 1 n')
.expect('test.groups.empty 0 0 n')
.expect('.');
});
Expand Down Expand Up @@ -725,25 +725,25 @@ describe('commands', function () {
return client
.send('NEWGROUPS 990101 000000')
.expect(/^215 /)
.expect('test.groups.foo 1 2 n')
.expect('test.groups.bar 1 3 n')
.expect('test.groups.foo 2 1 n')
.expect('test.groups.bar 3 1 n')
.expect('.');
});

it('2-digits year (current century)', function () {
return client
.send('NEWGROUPS 110101 000000')
.expect(/^215 /)
.expect('test.groups.bar 1 3 n')
.expect('test.groups.bar 3 1 n')
.expect('.');
});

it('4-digits year', function () {
return client
.send('NEWGROUPS 19990101 000000')
.expect(/^215 /)
.expect('test.groups.foo 1 2 n')
.expect('test.groups.bar 1 3 n')
.expect('test.groups.foo 2 1 n')
.expect('test.groups.bar 3 1 n')
.expect('.');
});

Expand Down

0 comments on commit 689e956

Please sign in to comment.