Skip to content

Commit

Permalink
$mol_view_tree2_to_js_test $mol_view to $mol_object, some type tests
Browse files Browse the repository at this point in the history
  • Loading branch information
zerkalica committed Nov 4, 2023
1 parent 64e9721 commit 4fb990c
Show file tree
Hide file tree
Showing 48 changed files with 73 additions and 63 deletions.
4 changes: 2 additions & 2 deletions view/tree2/to/js/test/ex/aarray_constructor_tuple.view.tree
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
$mol_view_tree2_to_js_test_ex_array_constructor_tuple_foo $mol_view
blobs /$mol_view
$mol_view_tree2_to_js_test_ex_array_constructor_tuple_foo $mol_object
blobs /$mol_object
<= text_blob? $mol_view_tree2_to_js_test_ex_klass_tuple /
/string <= text \123
2 changes: 1 addition & 1 deletion view/tree2/to/js/test/ex/array_boolean.view.tree
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
$mol_view_tree2_to_js_test_ex_array_boolean_foo $mol_view
$mol_view_tree2_to_js_test_ex_array_boolean_foo $mol_object
bar /boolean
false
true
2 changes: 1 addition & 1 deletion view/tree2/to/js/test/ex/array_indexed.view.tree
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
$mol_view_tree2_to_js_test_ex_array_indexed_foo $mol_view
$mol_view_tree2_to_js_test_ex_array_indexed_foo $mol_object
tags* /string
<= tag1* \t1
^ slot* /
Expand Down
2 changes: 1 addition & 1 deletion view/tree2/to/js/test/ex/array_inheritance.view.tree
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
$mol_view_tree2_to_js_test_ex_array_inheritance_foo $mol_view
$mol_view_tree2_to_js_test_ex_array_inheritance_foo $mol_object
arr /
\v1
$mol_view_tree2_to_js_test_ex_array_inheritance_bar $mol_view_tree2_to_js_test_ex_array_inheritance_foo
Expand Down
2 changes: 1 addition & 1 deletion view/tree2/to/js/test/ex/array_number.view.tree
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
$mol_view_tree2_to_js_test_ex_array_number_foo $mol_view
$mol_view_tree2_to_js_test_ex_array_number_foo $mol_object
bar /
- NaN
-Infinity
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
$mol_view_tree2_to_js_test_ex_array_of_array_or_object_foo $mol_view
$mol_view_tree2_to_js_test_ex_array_of_array_or_object_foo $mol_object
complex /
/number|string
1
Expand Down
2 changes: 1 addition & 1 deletion view/tree2/to/js/test/ex/array_slot.view.tree
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
$mol_view_tree2_to_js_test_ex_array_slot_foo $mol_view
$mol_view_tree2_to_js_test_ex_array_slot_foo $mol_object
foot /string|number|boolean
1
2
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
$mol_view_tree2_to_js_test_ex_array_spread_other_bar $mol_view
$mol_view_tree2_to_js_test_ex_array_spread_other_bar $mol_object
sup /
\v1
arr /
Expand Down
2 changes: 1 addition & 1 deletion view/tree2/to/js/test/ex/array_with_types.view.tree
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
$mol_view_tree2_to_js_test_ex_array_with_types_foo $mol_view
$mol_view_tree2_to_js_test_ex_array_with_types_foo $mol_object
arr /readonly(number)[]
2 changes: 1 addition & 1 deletion view/tree2/to/js/test/ex/bidi_chaining.view.tree
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
$mol_view_tree2_to_js_test_ex_bidi_chaining_foo $mol_view
$mol_view_tree2_to_js_test_ex_bidi_chaining_foo $mol_object
a? <=> b? <=> c? null
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
$mol_view_tree2_to_js_test_ex_bidi_doubing_right_part_with_same_default_foo $mol_view
$mol_view_tree2_to_js_test_ex_bidi_doubing_right_part_with_same_default_foo $mol_object
a? <=> b? false
c? <=> b? false
2 changes: 1 addition & 1 deletion view/tree2/to/js/test/ex/bidi_fallback.view.tree
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
$mol_view_tree2_to_js_test_ex_bidi_fallback_foo $mol_view
$mol_view_tree2_to_js_test_ex_bidi_fallback_foo $mol_object
bar1? <=> bar2? 1
2 changes: 1 addition & 1 deletion view/tree2/to/js/test/ex/bidi_in_dictionary.view.tree
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
$mol_view_tree2_to_js_test_ex_bidi_in_dictionary_foo $mol_view
$mol_view_tree2_to_js_test_ex_bidi_in_dictionary_foo $mol_object
event *
click? <=> run? null
2 changes: 1 addition & 1 deletion view/tree2/to/js/test/ex/bidi_indexed.view.tree
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
$mol_view_tree2_to_js_test_ex_bidi_indexed_foo $mol_view
$mol_view_tree2_to_js_test_ex_bidi_indexed_foo $mol_object
indexed*? <=> owner*? null
4 changes: 2 additions & 2 deletions view/tree2/to/js/test/ex/bidi_indexed_second_level.view.tree
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
$mol_view_tree2_to_js_test_ex_bidi_indexed_second_level_bar $mol_view
$mol_view_tree2_to_js_test_ex_bidi_indexed_second_level_bar $mol_object
expanded \
$mol_view_tree2_to_js_test_ex_bidi_indexed_second_level_foo $mol_view
$mol_view_tree2_to_js_test_ex_bidi_indexed_second_level_foo $mol_object
indexed*? $mol_view_tree2_to_js_test_ex_bidi_indexed_second_level_bar
expanded <=> owner*? \w
2 changes: 1 addition & 1 deletion view/tree2/to/js/test/ex/bidi_legacy_value.view.tree
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
$mol_view_tree2_to_js_test_ex_bidi_legacy_value_foo $mol_view
$mol_view_tree2_to_js_test_ex_bidi_legacy_value_foo $mol_object
a?v <=> b?v 1
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
$mol_view_tree2_to_js_test_ex_bidi_localized_default_value_foo $mol_view
$mol_view_tree2_to_js_test_ex_bidi_localized_default_value_foo $mol_object
a? <=> b? @ \some1
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
$mol_view_tree2_to_js_test_ex_bidi_localized_in_object_foo $mol_view
$mol_view_tree2_to_js_test_ex_bidi_localized_in_object_foo $mol_object
obj *
loc? <=> outer? @ \test1
4 changes: 2 additions & 2 deletions view/tree2/to/js/test/ex/bidi_with_default_object.view.tree
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
$mol_view_tree2_to_js_test_ex_bidi_with_default_object_foo $mol_view
class? <=> owner? $mol_view
$mol_view_tree2_to_js_test_ex_bidi_with_default_object_foo $mol_object
class? <=> owner? $mol_object
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
$mol_view_tree2_to_js_test_ex_bidi_with_separate_default_in_right_part_foo $mol_view
$mol_view_tree2_to_js_test_ex_bidi_with_separate_default_in_right_part_foo $mol_object
b? false
a? <=> b?
2 changes: 1 addition & 1 deletion view/tree2/to/js/test/ex/klass.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
namespace $ {
export class $mol_view_tree2_to_js_test_ex_klass_tuple {
constructor(readonly tuple: readonly string[]) {}
constructor(readonly tuple: readonly string[] = []) {}
}
}
2 changes: 1 addition & 1 deletion view/tree2/to/js/test/ex/left_chaining.view.tree
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
$mol_view_tree2_to_js_test_ex_left_chaining_foo $mol_view
$mol_view_tree2_to_js_test_ex_left_chaining_foo $mol_object
a <= b <= c? 0
4 changes: 2 additions & 2 deletions view/tree2/to/js/test/ex/left_in_array_and_object.view.tree
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
$mol_view_tree2_to_js_test_ex_left_in_array_and_object_bar $mol_view
$mol_view_tree2_to_js_test_ex_left_in_array_and_object_bar $mol_object
rows /
$mol_view_tree2_to_js_test_ex_left_in_array_and_object_foo $mol_view
$mol_view_tree2_to_js_test_ex_left_in_array_and_object_foo $mol_object
obj *
prop <= Obj
arr /
Expand Down
2 changes: 1 addition & 1 deletion view/tree2/to/js/test/ex/left_read_only.view.tree
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
$mol_view_tree2_to_js_test_ex_left_read_only_foo $mol_view
$mol_view_tree2_to_js_test_ex_left_read_only_foo $mol_object
bar1 <= bar2? 1
4 changes: 2 additions & 2 deletions view/tree2/to/js/test/ex/left_second_level_index.view.tree
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
$mol_view_tree2_to_js_test_ex_left_second_level_index_bar $mol_view
$mol_view_tree2_to_js_test_ex_left_second_level_index_bar $mol_object
localized \

$mol_view_tree2_to_js_test_ex_left_second_level_index_foo $mol_view
$mol_view_tree2_to_js_test_ex_left_second_level_index_foo $mol_object
cls* <= owner*? $mol_view_tree2_to_js_test_ex_left_second_level_index_bar
localized <= some*? @ \v1
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
$mol_view_tree2_to_js_test_ex_left_with_separate_default_and_comment_bar $mol_view
$mol_view_tree2_to_js_test_ex_left_with_separate_default_and_comment_bar $mol_object
rows /
$mol_view_tree2_to_js_test_ex_left_with_separate_default_and_comment_foo $mol_view
$mol_view_tree2_to_js_test_ex_left_with_separate_default_and_comment_foo $mol_object
content 123
Obj $mol_view_tree2_to_js_test_ex_left_with_separate_default_and_comment_bar
rows / <= content - 321
4 changes: 2 additions & 2 deletions view/tree2/to/js/test/ex/right_in_left_bind.view.tree
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
$mol_view_tree2_to_js_test_ex_right_in_left_foo $mol_view
$mol_view_tree2_to_js_test_ex_right_in_left_foo $mol_object
a null
$mol_view_tree2_to_js_test_ex_right_in_left_bar $mol_view
$mol_view_tree2_to_js_test_ex_right_in_left_bar $mol_object
foo <= Cls $mol_view_tree2_to_js_test_ex_right_in_left_foo
a => b
4 changes: 2 additions & 2 deletions view/tree2/to/js/test/ex/right_indexed.view.tree
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
$mol_view_tree2_to_js_test_ex_right_indexed_foo $mol_view
$mol_view_tree2_to_js_test_ex_right_indexed_foo $mol_object
a? *
some 123
$mol_view_tree2_to_js_test_ex_right_indexed_bar $mol_view
$mol_view_tree2_to_js_test_ex_right_indexed_bar $mol_object
Cls* $mol_view_tree2_to_js_test_ex_right_indexed_foo
a => b*
4 changes: 2 additions & 2 deletions view/tree2/to/js/test/ex/right_read_only.view.tree
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
$mol_view_tree2_to_js_test_ex_right_read_only_foo $mol_view
$mol_view_tree2_to_js_test_ex_right_read_only_foo $mol_object
a*? null
$mol_view_tree2_to_js_test_ex_right_read_only_bar $mol_view
$mol_view_tree2_to_js_test_ex_right_read_only_bar $mol_object
Obj $mol_view_tree2_to_js_test_ex_right_read_only_foo
a*? => b*?
2 changes: 1 addition & 1 deletion view/tree2/to/js/test/ex/simple_default_indexed.view.tree
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
$mol_view_tree2_to_js_test_ex_simple_default_indexed_foo $mol_view
$mol_view_tree2_to_js_test_ex_simple_default_indexed_foo $mol_object
a_b*? 0
legacy*k?v 0
2 changes: 1 addition & 1 deletion view/tree2/to/js/test/ex/simple_empty_class.view.tree
Original file line number Diff line number Diff line change
@@ -1 +1 @@
$mol_view_tree2_to_js_test_ex_simple_empty_class_foo $mol_view
$mol_view_tree2_to_js_test_ex_simple_empty_class_foo $mol_object
4 changes: 2 additions & 2 deletions view/tree2/to/js/test/ex/simple_factory_props.view.tree
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
$mol_view_tree2_to_js_test_ex_simple_factory_props_bar $mol_view
$mol_view_tree2_to_js_test_ex_simple_factory_props_bar $mol_object
sub /number
loc \v2
some false

$mol_view_tree2_to_js_test_ex_simple_factory_props_foo $mol_view
$mol_view_tree2_to_js_test_ex_simple_factory_props_foo $mol_object
button $mol_view_tree2_to_js_test_ex_simple_factory_props_bar
some true
loc @ \v1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
$mol_view_tree2_to_js_test_ex_simple_mutable_and_read_only_foo $mol_view
$mol_view_tree2_to_js_test_ex_simple_mutable_and_read_only_foo $mol_object
readonly null
mutable? null
2 changes: 1 addition & 1 deletion view/tree2/to/js/test/ex/simple_nan.view.tree
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
$mol_view_tree2_to_js_test_ex_simple_nan_foo $mol_view
$mol_view_tree2_to_js_test_ex_simple_nan_foo $mol_object
a NaN
b +NaN
c -NaN
Expand Down
2 changes: 1 addition & 1 deletion view/tree2/to/js/test/ex/simple_string.view.tree
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
$mol_view_tree2_to_js_test_ex_simple_string_foo $mol_view
$mol_view_tree2_to_js_test_ex_simple_string_foo $mol_object
hardcoded \
\First
\Second
Expand Down
2 changes: 1 addition & 1 deletion view/tree2/to/js/test/ex/simple_two_classes.view.tree
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
$mol_view_tree2_to_js_test_ex_simple_two_classes_foo $mol_view
$mol_view_tree2_to_js_test_ex_simple_two_classes_foo $mol_object
str \some
$mol_view_tree2_to_js_test_ex_simple_two_classes_bar $mol_view_tree2_to_js_test_ex_simple_two_classes_foo
str \some2
2 changes: 1 addition & 1 deletion view/tree2/to/js/test/ex/structural.view.tree
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
$mol_view_tree2_to_js_test_ex_structural_foo $mol_view
$mol_view_tree2_to_js_test_ex_structural_foo $mol_object
bar *
alpha 1
beta *
Expand Down
2 changes: 1 addition & 1 deletion view/tree2/to/js/test/ex/structural_complex_key.view.tree
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
$mol_view_tree2_to_js_test_ex_structural_complex_key_foo $mol_view
$mol_view_tree2_to_js_test_ex_structural_complex_key_foo $mol_object
dictionary *
\raw data key
\1
Expand Down
2 changes: 1 addition & 1 deletion view/tree2/to/js/test/ex/structural_dict.view.tree
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
$mol_view_tree2_to_js_test_ex_structural_dict_foo $mol_view
$mol_view_tree2_to_js_test_ex_structural_dict_foo $mol_object
bar *
alpha 1
beta \a
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
$mol_view_tree2_to_js_test_ex_structural_localized_prop_value_foo $mol_view
$mol_view_tree2_to_js_test_ex_structural_localized_prop_value_foo $mol_object
bar *
loc @ \\v1
baz *
Expand Down
2 changes: 1 addition & 1 deletion view/tree2/to/js/test/ex/structural_quoted_props.view.tree
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
$mol_view_tree2_to_js_test_ex_structural_quoted_props_foo $mol_view
$mol_view_tree2_to_js_test_ex_structural_quoted_props_foo $mol_object
bar *
$a 1
b-t *
2 changes: 1 addition & 1 deletion view/tree2/to/js/test/ex/structural_spread_other.view.tree
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
$mol_view_tree2_to_js_test_ex_structural_spread_other_foo $mol_view
$mol_view_tree2_to_js_test_ex_structural_spread_other_foo $mol_object
test *
aaa 123
field *
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
$mol_view_tree2_to_js_test_ex_structural_with_inheritance_foo $mol_view
$mol_view_tree2_to_js_test_ex_structural_with_inheritance_foo $mol_object
field *
xxx 123
xxy \test
Expand Down
10 changes: 10 additions & 0 deletions view/tree2/to/js/test/js.array.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,16 @@ namespace $ {
const _foo = $mol_view_tree2_to_js_test_ex_array_constructor_tuple_foo
const foo = _foo.make({ $ })

type a0 = $mol_type_assert<
ReturnType<typeof foo['text_blob']>,
$mol_view_tree2_to_js_test_ex_klass_tuple
>

type a1 = $mol_type_assert<
ReturnType<typeof foo['blobs']>,
readonly $mol_view_tree2_to_js_test_ex_klass_tuple[]
>

$mol_assert_like(
foo.text_blob().tuple,
[ '123' ]
Expand Down
6 changes: 3 additions & 3 deletions view/tree2/to/js/test/js.bidi.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,8 @@ namespace $ {
// 'Bidi bind index from outer scope throws error'( $ ) {
// $mol_assert_fail(() => {
// $mol_view_tree2_to_js_test_run(`
// Foo $mol_view
// a*? $mol_view
// Foo $mol_object
// a*? $mol_object
// expanded <=> cell_test_expanded*? null
// `)
// })
Expand All @@ -161,7 +161,7 @@ namespace $ {
'Bidi bind with default object'( $ ) {
const _foo = $mol_view_tree2_to_js_test_ex_bidi_with_default_object_foo
const foo = _foo.make({ $ })
const view = new $mol_view
const view = new $mol_object
foo.owner(view)

$mol_assert_like(
Expand Down
2 changes: 1 addition & 1 deletion view/tree2/to/js/test/js.left.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ namespace $ {
const _foo = $mol_view_tree2_to_js_test_ex_left_second_level_index_foo
const foo = _foo.make({ $ })

$mol_assert_ok(foo.owner(1) instanceof $mol_view)
$mol_assert_ok(foo.owner(1) instanceof $mol_object)
$mol_assert_like(
foo.some(1),
foo.some(1),
Expand Down
10 changes: 5 additions & 5 deletions view/tree2/to/js/test/js.simple.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,14 @@ namespace $ {
'simple empty legacy indexed channel throws error'( $ ) {
$mol_assert_fail(() => {
$mol_view_tree2_to_js_test_run(`
Foo $mol_view
Foo $mol_object
a!? null
`)
})

$mol_assert_fail(() => {
$mol_view_tree2_to_js_test_run(`
Foo $mol_view
Foo $mol_object
b! 1
`)
})
Expand All @@ -97,8 +97,8 @@ namespace $ {

'simple commented node'( $ ) {
const { Foo } = $mol_view_tree2_to_js_test_run(`
- Foo $mol_view
a!? $mol_view
- Foo $mol_object
a!? $mol_object
expanded <=> cell_test_expanded!? null
`)
$mol_assert_ok(Foo === undefined)
Expand Down Expand Up @@ -136,7 +136,7 @@ namespace $ {
'extra char' ($) {
$mol_assert_fail(() => {
$mol_view_tree2_to_js_test_run(`
Foo $mol_view
Foo $mol_object
item_чount 50
`)
})
Expand Down
2 changes: 1 addition & 1 deletion view/tree2/to/js/test/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ namespace $ {

export function $mol_view_tree2_to_js_test_run( tree: string ): any {
class $mol_view_mock extends $mol_object {}
const $ = { $mol_view: $mol_view_mock }
const $ = { $mol_object: $mol_view_mock }
;( $mol_view_mock as any )[$mol_ambient_ref] = $

const name = $mol_view_tree2_to_js_test_id(2, true)
Expand Down

0 comments on commit 4fb990c

Please sign in to comment.