# The MIT License (MIT) # Copyright (c) 2016-2024 Objectionary.com # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. title: Dataization tests tests: - name: "Celsius example" dependencies: - ./data/0.50.0/org/eolang/number.phi - ./data/0.50.0/org/eolang/bytes.phi input: | { ⟦ c ↦ Φ̇.number( as-bytes ↦ Φ̇.bytes( ⟦ Δ ⤍ 40-39-00-00-00-00-00-00 ⟧ ) ), φ ↦ ξ.c.times( x ↦ ⟦ Δ ⤍ 3F-FC-CC-CC-CC-CC-CC-CD ⟧ ).plus( x ↦ ⟦ Δ ⤍ 40-40-00-00-00-00-00-00 ⟧ ) ⟧ } output: object: "77.0" - name: "Equality of booleans (via equality of bytes)" dependencies: - ./data/0.50.0/org/eolang/bytes.phi - ./data/0.50.0/org/eolang/true.phi - ./data/0.50.0/org/eolang/false.phi input: | { ⟦ φ ↦ Φ̇.true.eq(α0 ↦ Φ̇.true) ⟧ } output: bytes: "01-" - name: "Program with ξ.ρ.ρ" dependencies: [] input: | { ⟦ x ↦ ⟦ b ↦ ⟦ Δ ⤍ 01- ⟧, φ ↦ ⟦ b ↦ ⟦ Δ ⤍ 02- ⟧, c ↦ ⟦ a ↦ ξ.ρ.ρ.b, ρ ↦ ∅ ⟧.a, ρ ↦ ∅ ⟧.c, ρ ↦ ∅ ⟧.φ, λ ⤍ Package ⟧ } output: object: | ⟦ x ↦ ⟦ Δ ⤍ 01- ⟧, λ ⤍ Package ⟧ - name: "Preprocessing and dispatch" dependencies: [] input: | { ⟦ a ↦ ⟦ b ↦ ⟦ Δ ⤍ 01- ⟧ ⟧.b, λ ⤍ Package ⟧ } output: object: | ⟦ a ↦ ⟦ Δ ⤍ 01- ⟧, λ ⤍ Package ⟧ - name: "New values in copy through ξ" dependencies: [] input: | { ⟦ a ↦ ⟦ b ↦ ∅, c ↦ ξ.b ⟧, d ↦ ξ.a( b ↦ ⟦ Δ ⤍ 01- ⟧ ).c, λ ⤍ Package ⟧ } output: object: | ⟦ a ↦ ⟦ b ↦ ∅, c ↦ ξ.b ⟧, d ↦ ⟦ Δ ⤍ 01- ⟧, λ ⤍ Package ⟧ - name: "ρ-applications and stacked dispatches" dependencies: [] input: | { ⟦ x ↦ ⟦ a ↦ ⟦ b ↦ ⟦ c ↦ ⟦ Δ ⤍ 01- ⟧ ⟧ ⟧ ⟧.a.b.c, λ ⤍ Package ⟧ } output: object: | ⟦ x ↦ ⟦ Δ ⤍ 01- ⟧, λ ⤍ Package ⟧ - name: "ρ-applications and immediate dispatches" dependencies: [] input: | { ⟦ x ↦ ⟦ a ↦ ⟦ b ↦ ⟦ c ↦ ⟦ Δ ⤍ 01- ⟧ ⟧.c ⟧.b ⟧.a, λ ⤍ Package ⟧ } output: object: | ⟦ x ↦ ⟦ Δ ⤍ 01- ⟧, λ ⤍ Package ⟧ - name: "new values in copy through ρ" dependencies: [] input: | { ⟦ x ↦ ⟦ a ↦ ⟦ b ↦ ξ.ρ.c ⟧.b, c ↦ ∅ ⟧, d ↦ ξ.x( c ↦ ⟦ Δ ⤍ 01- ⟧ ).a, λ ⤍ Package ⟧ } output: object: | ⟦ x ↦ ⟦ a ↦ ⟦ b ↦ ξ.ρ.c ⟧.b, c ↦ ∅ ⟧, d ↦ ⟦ Δ ⤍ 01- ⟧, λ ⤍ Package ⟧ - name: "ρ and nested dispatches" dependencies: [] input: | { ⟦ x ↦ ⟦ a ↦ ⟦ b ↦ ⟦ c ↦ ξ.ρ ⟧.c ⟧.b ⟧.a, λ ⤍ Package ⟧ } output: object: | ⟦ x ↦ ⟦ b ↦ ⟦ c ↦ ξ.ρ ⟧.ρ, ρ ↦ ⟦ a ↦ ⟦ b ↦ ⟦ c ↦ ξ.ρ ⟧.ρ ⟧ ⟧ ⟧, λ ⤍ Package ⟧ - name: "usage of Φ with a loop" dependencies: [] input: | { ⟦ a ↦ ⟦ b ↦ Φ.a ⟧, λ ⤍ Package ⟧ } output: object: | ⟦ a ↦ ⟦ b ↦ Φ.a ⟧, λ ⤍ Package ⟧ - name: "ρ passed to both term of object application?" dependencies: [] input: | { ⟦ x ↦ ⟦ c ↦ ⟦ a ↦ ∅ ⟧( a ↦ ⟦ d ↦ ξ.ρ ⟧ ) ⟧.c, λ ⤍ Package ⟧ } output: object: | ⟦ x ↦ ⟦ a ↦ ⟦ d ↦ ξ.ρ, ρ ↦ ⟦ c ↦ ⟦ a ↦ ∅ ⟧(a ↦ ⟦ d ↦ ξ.ρ ⟧) ⟧ ⟧, ρ ↦ ⟦ c ↦ ⟦ a ↦ ∅ ⟧(a ↦ ⟦ d ↦ ξ.ρ ⟧) ⟧ ⟧, λ ⤍ Package ⟧ - name: "Object with ξ.ρ is an argument in application" dependencies: [] input: | { ⟦ a ↦ ⟦ b ↦ ∅, x ↦ ⟦ Δ ⤍ 01- ⟧ ⟧( b ↦ ⟦ c ↦ ξ.ρ.x ⟧ ).b.c, x ↦ ⟦ Δ ⤍ 02- ⟧, λ ⤍ Package ⟧ } output: object: | ⟦ a ↦ ⟦ Δ ⤍ 02- ⟧, x ↦ ⟦ Δ ⤍ 02- ⟧, λ ⤍ Package ⟧ # TODO #636:30min hangs # - name: "ξ in application" # dependencies: [] # input: | # {⟦ x ↦ ⟦ a ↦ ∅ ⟧(a ↦ ξ.b), b ↦ ⟦ Δ ⤍ 01- ⟧ , λ ⤍ Package ⟧} # output: # object: | # ⟦ x ↦ ⟦ # a ↦ ⟦ # Δ ⤍ 01-, # ρ ↦ ⟦ # b ↦ ⟦ Δ ⤍ 01- ⟧, # x ↦ ⟦ a ↦ ∅ ⟧ (a ↦ ξ.b), # λ ⤍ Package # ⟧ # ⟧ # ⟧, # b ↦ ⟦ Δ ⤍ 01- ⟧, # λ ⤍ Package # ⟧ - name: "ξ chain" dependencies: [] input: | { ⟦ a ↦ ξ.b, b ↦ ξ.c, c ↦ ξ.d, d ↦ ⟦ Δ ⤍ 01- ⟧, λ ⤍ Package ⟧ } output: object: | ⟦ a ↦ ⟦ Δ ⤍ 01- ⟧, b ↦ ⟦ Δ ⤍ 01- ⟧, c ↦ ⟦ Δ ⤍ 01- ⟧, d ↦ ⟦ Δ ⤍ 01- ⟧, λ ⤍ Package ⟧ # TODO #636:30min fails # - name: "cross-reference (1)" # dependencies: [] # input: | # {⟦ x ↦ ⟦ a ↦ ⟦ b ↦ ξ.ρ.d.e, c ↦ ⟦ Δ ⤍ 01- ⟧, ρ ↦ ∅ ⟧, d ↦ ⟦ e ↦ ξ.ρ.a.c, ρ ↦ ∅ ⟧, ρ ↦ ∅ ⟧.a.b , λ ⤍ Package ⟧} # output: # object: | # NOT ⟦ x ↦ ⊥, λ ⤍ Package ⟧ # TODO #636:30min fails # - name: "cross-reference (2)" # dependencies: [] # input: | # {⟦ x ↦ ⟦ a ↦ ⟦ b ↦ ξ.ρ.d.e, c ↦ ξ.ρ.d.f ⟧, d ↦ ⟦ e ↦ ξ.ρ.a.c, f ↦ ⟦ Δ ⤍ 01- ⟧ ⟧ ⟧.a.b , λ ⤍ Package ⟧} # output: # object: | # NOT ⟦ x ↦ ⊥, λ ⤍ Package ⟧ # TODO #636:30min fails # - name: "cross-reference + dispatch (1)" # dependencies: [] # input: | # {⟦ x ↦ ⟦ a ↦ ⟦ b ↦ ξ.ρ.d, c ↦ ⟦ Δ ⤍ 01- ⟧ ⟧, d ↦ ⟦ e ↦ ξ.ρ.a.c ⟧ ⟧.a.b.e , λ ⤍ Package ⟧} # output: # object: | # NOT ⟦ x ↦ ⊥, λ ⤍ Package ⟧ # TODO #636:30min fails # - name: "cross-reference + dispatch (1)" # dependencies: [] # input: | # {⟦ x ↦ ⟦ a ↦ ⟦ b ↦ ξ.ρ.d, c ↦ ⟦ Δ ⤍ 01- ⟧ ⟧, d ↦ ⟦ e ↦ ξ.ρ.a.c ⟧ ⟧.a.b.e , λ ⤍ Package ⟧} # output: # object: | # NOT ⟦ x ↦ ⊥, λ ⤍ Package ⟧ # TODO #636:30min fails # - name: "cross-reference + dispatch (2)" # dependencies: [] # input: | # {⟦ x ↦ ⟦ a ↦ ⟦ b ↦ ξ.ρ.d, c ↦ ξ.ρ.d.f ⟧, d ↦ ⟦ e ↦ ξ.ρ.a.c, f ↦ ⟦ Δ ⤍ 01- ⟧ ⟧ ⟧.a.b.e , λ ⤍ Package ⟧} # output: # object: | # NOT ⟦ x ↦ ⊥, λ ⤍ Package ⟧ # TODO #636:30min fails # - name: "cross-reference + dispatch (3)" # dependencies: [] # input: | # {⟦ x ↦ ⟦ a ↦ ⟦ b ↦ ξ.ρ.d, c ↦ ξ.ρ.d ⟧, d ↦ ⟦ e ↦ ξ.ρ.a.c, f ↦ ⟦ Δ ⤍ 01- ⟧ ⟧ ⟧.a.b.e.f , λ ⤍ Package ⟧} # output: # object: | # NOT ⟦ x ↦ ⊥, λ ⤍ Package ⟧ # TODO #636:30min fails # - name: "interleaving ρ and other dispatches" # dependencies: [] # input: | # {⟦ x ↦ ⟦ a ↦ ξ.ρ.b.ρ.c ⟧.a, b ↦ ⟦⟧, c ↦ ⟦ Δ ⤍ 01- ⟧, λ ⤍ Package ⟧} # output: # object: | # NOT ⟦ x ↦ ⟦ ⟧.ρ.b.ρ.c, b ↦ ⟦ ⟧, c ↦ ⟦ Δ ⤍ 01- ⟧, λ ⤍ Package ⟧ - name: "Dataize in siblings of Package" dependencies: - ./data/0.50.0/org/eolang/bytes.phi input: | { ⟦ org ↦ ⟦ eolang ↦ ⟦ bool ↦ ⟦ α0 ↦ ∅, φ ↦ ξ.α0 ⟧, x ↦ ⟦ φ ↦ Φ̇.bool( Φ̇.bytes( ⟦ Δ ⤍ 01- ⟧ ) ) ⟧, z ↦ ⟦ y ↦ ⟦ x ↦ ∅, φ ↦ ξ.x ⟧, φ ↦ Φ̇.bool( Φ̇.bytes( ⟦ Δ ⤍ 01- ⟧ ) ) ⟧, λ ⤍ Package ⟧, λ ⤍ Package ⟧, λ ⤍ Package ⟧ } output: object: | ⟦ org ↦ ⟦ eolang ↦ ⟦ bool ↦ ⟦ α0 ↦ ∅, φ ↦ ξ.α0 ⟧, x ↦ ⟦ Δ ⤍ 01- ⟧, z ↦ ⟦ Δ ⤍ 01- ⟧, λ ⤍ Package ⟧, λ ⤍ Package ⟧, λ ⤍ Package ⟧ - name: "int times and plus" dependencies: - ./data/0.50.0/org/eolang/i64.phi - ./data/0.50.0/org/eolang/bytes.phi input: | { ⟦ φ ↦ ⟦ x ↦ ⟦ x ↦ ⟦ Δ ⤍ 09- ⟧, ρ ↦ ⟦ Δ ⤍ 04- ⟧, λ ⤍ Lorg_eolang_int_times ⟧, ρ ↦ ⟦ Δ ⤍ 06- ⟧, λ ⤍ Lorg_eolang_int_plus ⟧ ⟧ } output: object: "42" - name: "int greater than" dependencies: - ./data/0.50.0/org/eolang/i64.phi - ./data/0.50.0/org/eolang/bytes.phi - ./data/0.50.0/org/eolang/false.phi - ./data/0.50.0/org/eolang/true.phi input: | { ⟦ φ ↦ ⟦ ρ ↦ ⟦ Δ ⤍ 06- ⟧, x ↦ ⟦ Δ ⤍ 09- ⟧, λ ⤍ Lorg_eolang_int_gt ⟧ ⟧ } output: bytes: "00-" # TODO #636:30min Missing int tests: div - name: "bitwise and" dependencies: - ./data/0.50.0/org/eolang/bytes.phi input: | { ⟦ φ ↦ ⟦ b ↦ ⟦ Δ ⤍ 15- ⟧, ρ ↦ ⟦ Δ ⤍ 0D- ⟧, λ ⤍ Lorg_eolang_bytes_and ⟧ ⟧ } output: bytes: "00-00-00-00-00-00-00-05" - name: "bitwise not" dependencies: - ./data/0.50.0/org/eolang/bytes.phi input: | { ⟦ φ ↦ ⟦ ρ ↦ ⟦ Δ ⤍ 50-3D-10-C0-6F-12-42-69 ⟧, λ ⤍ Lorg_eolang_bytes_not ⟧ ⟧ } output: bytes: "AF-C2-EF-3F-90-ED-BD-96" - name: "bytes size" dependencies: - ./data/0.50.0/org/eolang/i64.phi - ./data/0.50.0/org/eolang/bytes.phi input: | { ⟦ φ ↦ ⟦ ρ ↦ ⟦ Δ ⤍ 00-11-22-33-44 ⟧, λ ⤍ Lorg_eolang_bytes_size ⟧ ⟧ } output: bytes: "00-00-00-00-00-00-00-05" - name: "bytes shift and equal" dependencies: - ./data/0.50.0/org/eolang/bytes.phi - ./data/0.50.0/org/eolang/true.phi - ./data/0.50.0/org/eolang/i64.phi - ./data/0.50.0/org/eolang/false.phi input: | { ⟦ φ ↦ ⟦ ρ ↦ ⟦ Δ ⤍ 02-24-46-68-8A-AC-CE-F1 ⟧, b ↦ ⟦ ρ ↦ ⟦ Δ ⤍ 11-22-33-44-55-66-77-88 ⟧, x ↦ 3, λ ⤍ Lorg_eolang_bytes_right ⟧, λ ⤍ Lorg_eolang_bytes_eq ⟧ ⟧ } output: bytes: "01-" # TODO #636:30min Missing bytes tests: or, xor, slice, concat - name: "float times and plus (raw bytes)" dependencies: - ./data/0.50.0/org/eolang/number.phi - ./data/0.50.0/org/eolang/bytes.phi input: | { ⟦ φ ↦ ⟦ x ↦ ⟦ x ↦ ⟦ Δ ⤍ 40-14-00-00-00-00-00-00 ⟧, ρ ↦ ⟦ Δ ⤍ 40-2A-66-66-66-66-66-66 ⟧, λ ⤍ Lorg_eolang_number_times ⟧, ρ ↦ ⟦ Δ ⤍ 40-0B-5C-28-F5-C2-8F-5C ⟧, λ ⤍ Lorg_eolang_number_plus ⟧ ⟧ } output: object: "69.42" - name: "float times and plus" dependencies: - ./data/0.50.0/org/eolang/number.phi - ./data/0.50.0/org/eolang/bytes.phi input: | { ⟦ φ ↦ ⟦ x ↦ ⟦ x ↦ 5.0, ρ ↦ 13.2, λ ⤍ Lorg_eolang_number_times ⟧, ρ ↦ 3.42, λ ⤍ Lorg_eolang_number_plus ⟧ ⟧ } output: object: "69.42" # TODO #636:30min Missing float tests: gt, div - name: "string slice (raw bytes)" dependencies: - ./data/0.50.0/org/eolang/string.phi - ./data/0.50.0/org/eolang/bytes.phi input: | { ⟦ φ ↦ ⟦ start ↦ ⟦ Δ ⤍ 40-00-00-00-00-00-00-00 ⟧, len ↦ ⟦ Δ ⤍ 40-14-00-00-00-00-00-00 ⟧, ρ ↦ ⟦ Δ ⤍ 48-65-6C-6C-6F-20-77-6F-72-6C-64 ⟧, λ ⤍ Lorg_eolang_string_slice ⟧ ⟧ } output: object: "\"llo w\"" - name: "string slice" dependencies: - ./data/0.50.0/org/eolang/string.phi - ./data/0.50.0/org/eolang/i64.phi - ./data/0.50.0/org/eolang/bytes.phi input: | { ⟦ φ ↦ ⟦ start ↦ 2.0, len ↦ 5.0, ρ ↦ "Hello world", λ ⤍ Lorg_eolang_string_slice ⟧ ⟧ } output: object: "\"llo w\"" - name: "string length (raw bytes)" dependencies: - ./data/0.50.0/org/eolang/string.phi - ./data/0.50.0/org/eolang/i64.phi - ./data/0.50.0/org/eolang/bytes.phi input: | { ⟦ φ ↦ ⟦ ρ ↦ ⟦ Δ ⤍ 48-65-6C-6C-6F-20-77-6F-72-6C-64 ⟧, λ ⤍ Lorg_eolang_string_length ⟧ ⟧ } output: object: "11" # == 11 - name: "string length" dependencies: - ./data/0.50.0/org/eolang/string.phi - ./data/0.50.0/org/eolang/i64.phi - ./data/0.50.0/org/eolang/bytes.phi input: | { ⟦ φ ↦ ⟦ ρ ↦ "Hello world", λ ⤍ Lorg_eolang_string_length ⟧ ⟧ } output: object: "11" # == 11 # TODO #636:30min Missing malloc tests: (all) # TODO #636:30min Missing cage tests: (all) # TODO #636:30min Missing io tests: (all) # TODO #636:30min Other missing tests: dataized, error, seq, as_phi, rust, try