src.elv.sh@v0.21.0-dev.0.20240515223629-06979efb9a2a/pkg/edit/completion_test.elvts (about)

     1  /////////////////////
     2  # complete-filename #
     3  /////////////////////
     4  //complete-filename-in-global
     5  // Don't crash with no argument. Regression test for b.elv.sh/1799.
     6  ~> complete-filename
     7  
     8  /////////////////////
     9  # complex-candidate #
    10  /////////////////////
    11  
    12  //each:complex-candidate-in-global
    13  
    14  ## construction ##
    15  ~> complex-candidate a/b
    16  ▶ (edit:complex-candidate a/b &code-suffix='' &display=[^styled])
    17  ~> complex-candidate a/b &code-suffix=' '
    18  ▶ (edit:complex-candidate a/b &code-suffix=' ' &display=[^styled])
    19  ~> complex-candidate a/b &code-suffix=' ' &display=A/B
    20  ▶ (edit:complex-candidate a/b &code-suffix=' ' &display=[^styled A/B])
    21  ~> complex-candidate a/b &code-suffix=' ' &display=(styled A/B red)
    22  ▶ (edit:complex-candidate a/b &code-suffix=' ' &display=[^styled (styled-segment A/B &fg-color=red)])
    23  ~> complex-candidate a/b &code-suffix=' ' &display=[]
    24  Exception: bad value: &display must be string or styled, but is []
    25    [tty]:1:1-50: complex-candidate a/b &code-suffix=' ' &display=[]
    26  
    27  ## value operations ##
    28  ~> kind-of (complex-candidate stem)
    29  ▶ map
    30  ~> keys (complex-candidate stem)
    31  ▶ stem
    32  ▶ code-suffix
    33  ▶ display
    34  ~> repr (complex-candidate a/b &code-suffix=' ' &display=A/B)
    35  (edit:complex-candidate a/b &code-suffix=' ' &display=[^styled A/B])
    36  ~> eq (complex-candidate stem) (complex-candidate stem)
    37  ▶ $true
    38  ~> eq (complex-candidate stem &code-suffix=' ') (complex-candidate stem)
    39  ▶ $false
    40  ~> eq (complex-candidate stem &display=STEM) (complex-candidate stem)
    41  ▶ $false
    42  ~> put [&(complex-candidate stem)=value][(complex-candidate stem)]
    43  ▶ value
    44  ~> put (complex-candidate a/b &code-suffix=' ' &display=A/B)[stem code-suffix display]
    45  ▶ a/b
    46  ▶ ' '
    47  ▶ [^styled A/B]