Files
Eric FELIXINE e30ae8ed09 feat(smart-app): implement complete mobile app MVP
- App.tsx: full navigation (Auth stack + Main tabs with 5 screens)
- Auth: LoginScreen, RegisterScreen, ForgotPasswordScreen
- HomeScreen: dashboard with IoT metrics, weather widget, alerts, quick actions, sensors
- MapScreen: interactive map with layer toggles (6 layers)
- MarketplaceScreen: categories (6), products (5), search
- ChatScreen: AI chat with quick prompts (4), bot responses
- ProfileScreen: user info, stats, menu (9 items), logout
- AlertsScreen: alert list with severity, acknowledge
- SensorsScreen: sensor list with type filters (6 types), search
- ZonesScreen: zone cards with stats
- SettingsScreen: language picker (FR/EN/ES/DE), privacy, about
- Stores: iotStore (sensors, zones, alerts), notificationStore, uiStore + i18n
- Hooks: useSensors, useAlerts, useNotifications, useLocation
- Components: Card, Button, LoadingSpinner, ErrorBoundary, Header
- Services: iotService, notificationService (with axios API client)
- Utils: formatters (temp, AQI, noise, dates), validators (email, password, IBAN)
- Theme: colors.ts with full design system (Blue Ocean palette)
- Ditto: fixed MongoDB connection, new JWT secrets, official gateway image
2026-06-01 18:00:35 -04:00

103 lines
3.0 KiB
JavaScript

'use strict';
var test = require('tape');
var parse = require('../').parse;
test('single operators', function (t) {
t.same(parse('beep | boop'), ['beep', { op: '|' }, 'boop']);
t.same(parse('beep|boop'), ['beep', { op: '|' }, 'boop']);
t.same(parse('beep \\| boop'), ['beep', '|', 'boop']);
t.same(parse('beep "|boop"'), ['beep', '|boop']);
t.same(parse('echo zing &'), ['echo', 'zing', { op: '&' }]);
t.same(parse('echo zing&'), ['echo', 'zing', { op: '&' }]);
t.same(parse('echo zing\\&'), ['echo', 'zing&']);
t.same(parse('echo "zing\\&"'), ['echo', 'zing\\&']);
t.same(parse('beep;boop'), ['beep', { op: ';' }, 'boop']);
t.same(parse('(beep;boop)'), [
{ op: '(' }, 'beep', { op: ';' }, 'boop', { op: ')' }
]);
t.same(parse('beep>boop'), ['beep', { op: '>' }, 'boop']);
t.same(parse('beep 2>boop'), ['beep', '2', { op: '>' }, 'boop']);
t.same(parse('beep<boop'), ['beep', { op: '<' }, 'boop']);
t.end();
});
test('double operators', function (t) {
t.same(parse('beep || boop'), ['beep', { op: '||' }, 'boop']);
t.same(parse('beep||boop'), ['beep', { op: '||' }, 'boop']);
t.same(parse('beep ||boop'), ['beep', { op: '||' }, 'boop']);
t.same(parse('beep|| boop'), ['beep', { op: '||' }, 'boop']);
t.same(parse('beep || boop'), ['beep', { op: '||' }, 'boop']);
t.same(parse('beep && boop'), ['beep', { op: '&&' }, 'boop']);
t.same(
parse('beep && boop || byte'),
['beep', { op: '&&' }, 'boop', { op: '||' }, 'byte']
);
t.same(
parse('beep&&boop||byte'),
['beep', { op: '&&' }, 'boop', { op: '||' }, 'byte']
);
t.same(
parse('beep\\&\\&boop||byte'),
['beep&&boop', { op: '||' }, 'byte']
);
t.same(
parse('beep\\&&boop||byte'),
['beep&', { op: '&' }, 'boop', { op: '||' }, 'byte']
);
t.same(
parse('beep;;boop|&byte>>blip'),
['beep', { op: ';;' }, 'boop', { op: '|&' }, 'byte', { op: '>>' }, 'blip']
);
t.same(parse('beep 2>&1'), ['beep', '2', { op: '>&' }, '1']);
t.same(
parse('beep<(boop)'),
['beep', { op: '<(' }, 'boop', { op: ')' }]
);
t.same(
parse('beep<<(boop)'),
['beep', { op: '<' }, { op: '<(' }, 'boop', { op: ')' }]
);
t.end();
});
test('duplicating input file descriptors', function (t) {
// duplicating stdout to file descriptor 3
t.same(parse('beep 3<&1'), ['beep', '3', { op: '<&' }, '1']);
// duplicating stdout to file descriptor 0, i.e. stdin
t.same(parse('beep <&1'), ['beep', { op: '<&' }, '1']);
// closes stdin
t.same(parse('beep <&-'), ['beep', { op: '<&' }, '-']);
t.end();
});
test('here strings', function (t) {
t.same(parse('cat <<< "hello world"'), ['cat', { op: '<<<' }, 'hello world']);
t.same(parse('cat <<< hello'), ['cat', { op: '<<<' }, 'hello']);
t.same(parse('cat<<<hello'), ['cat', { op: '<<<' }, 'hello']);
t.same(parse('cat<<<"hello world"'), ['cat', { op: '<<<' }, 'hello world']);
t.end();
});
test('glob patterns', function (t) {
t.same(
parse('tap test/*.test.js'),
['tap', { op: 'glob', pattern: 'test/*.test.js' }]
);
t.same(parse('tap "test/*.test.js"'), ['tap', 'test/*.test.js']);
t.end();
});