123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- (
- #comment
- (let config (DataSource 'config))
- (let res_sink (DataSink 'result))
- (let test (lambda '(world data dataType) (block '(
- (let world (Write! world res_sink (Key) (ToBytes data) '('('type))))
- (let world (Write! world res_sink (Key) (FromBytes (ToBytes data) dataType) '('('type))))
- (return world)
- ))))
- (let testEmpty (lambda '(world dataType) (block '(
- (let n (ToBytes (Nothing (OptionalType (DataType dataType)))))
- (let world (Write! world res_sink (Key) n '('('type))))
- (let world (Write! world res_sink (Key) (FromBytes n dataType) '('('type))))
- (return world)
- ))))
- (let testFail (lambda '(world bytes dataType) (block '(
- (let world (Write! world res_sink (Key) (Exists (FromBytes bytes dataType)) '('('type))))
- (return world)
- ))))
- (let world (Apply test world (Uint8 '7) 'Uint8))
- (let world (Apply test world (Bool 'True) 'Bool))
- (let world (Apply test world (Bool 'False) 'Bool))
- (let world (Apply test world (Int32 'x"abcdef12") 'Int32))
- (let world (Apply test world (Int64 'x"71717171abcdef12") 'Int64))
- (let world (Apply test world (Uint32 'x"abcdef12") 'Uint32))
- (let world (Apply test world (Uint64 'x"ddddddddabcdef12") 'Uint64))
- (let world (Apply test world (Float '2) 'Float))
- (let world (Apply test world (Double '2) 'Double))
- (let world (Apply test world (String '"abc") 'String))
- (let world (Apply test world (Utf8 '"яндекс") 'Utf8))
- (let world (Apply test world (Yson '"[1;2]") 'Yson))
- (let world (Apply test world (Json '@@{"id":1}@@) 'Json))
- (let world (Apply test world (Just (Uint8 '7)) 'Uint8))
- (let world (Apply test world (Just (Bool 'True)) 'Bool))
- (let world (Apply test world (Just (Bool 'False)) 'Bool))
- (let world (Apply test world (Just (Int32 'x"abcdef12")) 'Int32))
- (let world (Apply test world (Just (Int64 'x"71717171abcdef12")) 'Int64))
- (let world (Apply test world (Just (Uint32 'x"abcdef12")) 'Uint32))
- (let world (Apply test world (Just (Uint64 'x"ddddddddabcdef12")) 'Uint64))
- (let world (Apply test world (Just (Float '2)) 'Float))
- (let world (Apply test world (Just (Double '2)) 'Double))
- (let world (Apply test world (Just (String '"abc")) 'String))
- (let world (Apply test world (Just (Utf8 '"яндекс")) 'Utf8))
- (let world (Apply test world (Just (Yson '"[1;2]")) 'Yson))
- (let world (Apply test world (Just (Json '@@{"id":1}@@)) 'Json))
- (let world (Apply testEmpty world 'Uint8))
- (let world (Apply testEmpty world 'Bool))
- (let world (Apply testEmpty world 'Int32))
- (let world (Apply testEmpty world 'Int64))
- (let world (Apply testEmpty world 'Uint32))
- (let world (Apply testEmpty world 'Uint64))
- (let world (Apply testEmpty world 'Float))
- (let world (Apply testEmpty world 'Double))
- (let world (Apply testEmpty world 'String))
- (let world (Apply testEmpty world 'Utf8))
- (let world (Apply testEmpty world 'Yson))
- (let world (Apply testEmpty world 'Json))
- (let world (Apply testFail world (Nothing (OptionalType (DataType 'String))) 'Uint8))
- (let world (Apply testFail world (Nothing (OptionalType (DataType 'String))) 'Bool))
- (let world (Apply testFail world (Nothing (OptionalType (DataType 'String))) 'Int32))
- (let world (Apply testFail world (Nothing (OptionalType (DataType 'String))) 'Int64))
- (let world (Apply testFail world (Nothing (OptionalType (DataType 'String))) 'Uint32))
- (let world (Apply testFail world (Nothing (OptionalType (DataType 'String))) 'Uint64))
- (let world (Apply testFail world (Nothing (OptionalType (DataType 'String))) 'Float))
- (let world (Apply testFail world (Nothing (OptionalType (DataType 'String))) 'Double))
- (let world (Apply testFail world (Nothing (OptionalType (DataType 'String))) 'String))
- (let world (Apply testFail world (String 'x"ffff") 'Utf8))
- (let world (Apply testFail world (String '"][") 'Yson))
- (let world (Apply testFail world (String '"}{") 'Json))
- (let world (Commit! world res_sink))
- (return world)
- )
|