3
3
import * as Mocha from "mocha" ;
4
4
import * as Test_utils from "./test_utils.mjs" ;
5
5
import * as Stdlib_Option from "@rescript/runtime/lib/es6/Stdlib_Option.js" ;
6
+ import * as Belt_MapString from "@rescript/runtime/lib/es6/Belt_MapString.js" ;
6
7
import * as Primitive_option from "@rescript/runtime/lib/es6/Primitive_option.js" ;
7
8
9
+ function getIncidentCategoryName ( incidents , categories , incidentId ) {
10
+ let incident = incidentId !== undefined ? Belt_MapString . get ( incidents , incidentId ) : undefined ;
11
+ let categoryId = incident !== undefined ? incident . categoryId : undefined ;
12
+ let category = categoryId !== undefined ? Belt_MapString . get ( categories , categoryId ) : undefined ;
13
+ if ( category !== undefined ) {
14
+ return category . name ;
15
+ }
16
+
17
+ }
18
+
19
+ let PipeChain = {
20
+ getIncidentCategoryName : getIncidentCategoryName
21
+ } ;
22
+
8
23
function testPrimitive ( ) {
9
24
console . log ( 42 ) ;
10
25
}
@@ -348,12 +363,12 @@ Mocha.describe("Scope preservation in Option optimizations", () => {
348
363
return _value => { } ;
349
364
} ;
350
365
Stdlib_Option . forEach ( undefined , makeCallback ( ) ) ;
351
- Test_utils . eq ( "File \"option_stdlib_optimization_test.res\", line 337 , characters 7-14" , invocations . contents , 1 ) ;
366
+ Test_utils . eq ( "File \"option_stdlib_optimization_test.res\", line 481 , characters 7-14" , invocations . contents , 1 ) ;
352
367
} ) ;
353
368
Mocha . test ( "Option.forEach does not shadow surrounding bindings" , ( ) => {
354
369
let result ;
355
370
result = 89 + 1 | 0 ;
356
- Test_utils . eq ( "File \"option_stdlib_optimization_test.res\", line 350 , characters 7-14" , result , 90 ) ;
371
+ Test_utils . eq ( "File \"option_stdlib_optimization_test.res\", line 494 , characters 7-14" , result , 90 ) ;
357
372
} ) ;
358
373
Mocha . test ( "Option.map evaluates callback argument even when option is None" , ( ) => {
359
374
let invocations = {
@@ -364,11 +379,11 @@ Mocha.describe("Scope preservation in Option optimizations", () => {
364
379
return value => value ;
365
380
} ;
366
381
Stdlib_Option . map ( undefined , makeCallback ( ) ) ;
367
- Test_utils . eq ( "File \"option_stdlib_optimization_test.res\", line 362 , characters 7-14" , invocations . contents , 1 ) ;
382
+ Test_utils . eq ( "File \"option_stdlib_optimization_test.res\", line 506 , characters 7-14" , invocations . contents , 1 ) ;
368
383
} ) ;
369
384
Mocha . test ( "Option.map does not shadow surrounding bindings" , ( ) => {
370
385
let result = 89 + 1 | 0 ;
371
- Test_utils . eq ( "File \"option_stdlib_optimization_test.res\", line 368 , characters 7-14" , result , 90 ) ;
386
+ Test_utils . eq ( "File \"option_stdlib_optimization_test.res\", line 512 , characters 7-14" , result , 90 ) ;
372
387
} ) ;
373
388
Mocha . test ( "Option.flatMap evaluates callback argument even when option is None" , ( ) => {
374
389
let invocations = {
@@ -379,18 +394,19 @@ Mocha.describe("Scope preservation in Option optimizations", () => {
379
394
return value => Primitive_option . some ( value ) ;
380
395
} ;
381
396
Stdlib_Option . flatMap ( undefined , makeCallback ( ) ) ;
382
- Test_utils . eq ( "File \"option_stdlib_optimization_test.res\", line 380 , characters 7-14" , invocations . contents , 1 ) ;
397
+ Test_utils . eq ( "File \"option_stdlib_optimization_test.res\", line 524 , characters 7-14" , invocations . contents , 1 ) ;
383
398
} ) ;
384
399
Mocha . test ( "Option.flatMap does not shadow surrounding bindings" , ( ) => {
385
400
let result = 89 + 1 | 0 ;
386
- Test_utils . eq ( "File \"option_stdlib_optimization_test.res\", line 386 , characters 7-14" , result , 90 ) ;
401
+ Test_utils . eq ( "File \"option_stdlib_optimization_test.res\", line 530 , characters 7-14" , result , 90 ) ;
387
402
} ) ;
388
403
} ) ;
389
404
390
405
let globalValue = 89 ;
391
406
392
407
export {
393
408
globalValue ,
409
+ PipeChain ,
394
410
ForEach ,
395
411
$$Map ,
396
412
FlatMap ,
0 commit comments